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
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
Bump
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.
Could it be that the jquery reference is called a second time when the page goes into edit mode, thus disabling the bar?
Iain
Iain
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?
Any ideas?
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 :)
since you are saying you have this in your template, basically just wrap your javascript include in
moral of the story is you can disable whatever is messing with your issues via edit mode here.
<?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.
YES. This is it. Thanks!!
Thank you, ScottC. I was getting frustrated by errors caused by javascript implementation. This solves that problem nicely.