Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The attach behaviors should only run once on the current context. Specifically Drupal.behaviors.dhtmlMenu.attach should utilize the context passed from Drupal, and only modify DOM elements that are within said context.
If the attach behaviors are not run against the context, weird things happen. The expand / contract icons get added to the DOM multiple times, and other JS events happen more than once.
The attached patch should limit the functionality to the section of the DOM the current context refers to.
Comment | File | Size | Author |
---|---|---|---|
#3 | dhtml_menu-2459221-2.patch | 1.39 KB | cejams |
Comments
Comment #1
cejams CreditAttribution: cejams commentedComment #2
cejams CreditAttribution: cejams commentedComment #3
cejams CreditAttribution: cejams commentedComment #4
a.milkovsky#3 Works good
Comment #5
a.milkovskyComment #6
ajFernandez CreditAttribution: ajFernandez commented#3 Works good for me!
I had several issues with open/close behaviors when a view with Infinite Scroll is loaded in the same page.
Maybe this patch should be committed.
Comment #7
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedconflicts with https://www.drupal.org/node/1495496#comment-8589571
Comment #9
vuilComment #10
vuilComment #12
vuil