Javascript disabling in edit mode

Permalink 1 user found helpful
Hi all,

I have an expandable drop down at the top of my template, powered by Javascript. (you click on an icon and the section opens up).

I added a content block into the section, but when the site is in edit mode, the section doesn't expand any more, so it is inaccessible.

Any idea why edit mode should be disabling my script?

Iain

 
icowden replied on at Permalink Reply
Bump
bryanlewis replied on at Permalink Reply
bryanlewis
If you are using jquery make sure that your not calling it twice. I know that when it gets called twice it disables the edit bar.
icowden replied on at Permalink Reply
Could it be that the jquery reference is called a second time when the page goes into edit mode, thus disabling the bar?

Iain
nliv replied on at Permalink Reply
nliv
I'm running into a similar problem. I have a set of tabs activated by Javascript that are disabled in Edit mode, making the content in the non-active tabs inaccessible.

Any ideas?
Mnkras replied on at Permalink Reply
Mnkras
When a page is stuck in edit mode, there is a little bit of code that is executed that basically nulls all links, many expandables use the # link or javascript:void since those are links they will be rendered null, doing nothing, i have no idea how to get around that, thats just the reason :)
ScottC replied on at Permalink Reply
ScottC
since you are saying you have this in your template, basically just wrap your javascript include in

<?php
global $c;
if(!$c->isEditMode()){
?>
<script type="text/javascript" src=whatever></script>
<?php } //end of check of edit mode ?>


moral of the story is you can disable whatever is messing with your issues via edit mode here.
nliv replied on at Permalink Reply
nliv
YES. This is it. Thanks!!
mulderjoe replied on at Permalink Reply
Thank you, ScottC. I was getting frustrated by errors caused by javascript implementation. This solves that problem nicely.