Closed (fixed)
Project:
Accordion Menu
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
4 Jun 2012 at 11:06 UTC
Updated:
17 Apr 2019 at 01:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
aniebel commentedI temporarily fixed this by turning the animation to "false" but it still seems like it should not expand with or without animation if there are no children.
Comment #2
austonian commentedFollowing this issue as it is affecting my implementation of this module.
Comment #3
solotandem commentedaustonian, are you aware of the green "follow" button at top right? It is still "new" to many.
Any takers on submitting a patch?
Comment #4
chrsnlsn commentedI took a look in the module, didn't see an easy way to accomplish a permanent solution. Another short-term workaround for this is to stop the event by targeting the specific accordion header(s) you wish to not have the accordion effect on. It's working for me.
$(".accordion-menu-1 .accordion-header-1").click(function(event){
event.stopImmediatePropagation();
);
Comment #5
ryanfc78 commentedChris,
Where do you put this line of code? What file and does anything else need to be before it or after it? Tried copying and pasting a few places, but always got errors.
Thanks.
Comment #6
chrsnlsn commentedI started formatting my javascript like the following can be placed and called by your theme or from a theme helper module. Just change 'yourtheme' to your theme or module name and make sure the file is getting called and the correct accordion header is being targeted.
Comment #7
solotandem commentedIn this commit:
- removed accordion effect on "empty" headers (i.e., headers with no children)
- added empty header icon setting to use on empty headers
- added a plain "accordion-header" class to header elements.
Comment #8
solotandem commentedIn this commit for 6.x-1.x, document inability to remove accordion effect on "empty" headers when using jQuery UI 1.6 releases (common for Drupal 6). This is due to the event handler being attached to the entire menu as opposed to individual headers as in the 1.8 releases.
Comment #10
peacog commentedI'm reopening this because the unbinding of the accordion for menu items with no children was not working. Here is a patch that fixes it.
Comment #11
swim commentedHad the same issue as #10; Peacog's patch looks good.
Comment #12
Jedd Casella commentedPatch in #10 worked. Thanks Peacog.
Comment #13
volker23 commentedThe patch #10 doesn't work for me. Do I need a specific combination of jQuery version and CDN? If i select 1.8 and CDN: Jquery, it works almost as expected, but another error occurs, that is the same as described here: https://www.drupal.org/node/2260003
I tried every combination of "with patch" / Jquery version / CDN and "without patch" / Jquery version / CDN to no avail. Help is very appreciated...
Thanks
Comment #14
realobiwankenobi commentedHello, patch #10 is working, but try to avoid to hack the drupal core, so implement a hook in your module (this code should work with the latest 7.33) Drupal:
Comment #15
bgarner commented#14 works a treat. Cheers realobiwankenobi.
Nice solution and doesn't involve hacking modules !!
Comment #16
volker23 commentedThx realobiwankenobi, i tried this with a helper module and your snippet on a vanilla drupal 7.33, the latest dev of accordion-menu and jQuery-Update set to 1.7 (tested all cdn's and also without).
The menu-item without children still expands (on page load), though the animation for these items is gone (i guess this is what the "unbind" is doing).
Any other tips? Thanks a lot!
Comment #17
vvs commentedIf doing this with patch and CSS?
For me it helped.
Comment #18
codechefmarc#14 worked great for me too!
Comment #20
solotandem commentedThanks for reporting this and supplying a patch.