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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cejams’s picture

FileSize
1.5 KB
cejams’s picture

FileSize
1.43 KB
cejams’s picture

FileSize
1.39 KB
a.milkovsky’s picture

Status: Needs review » Reviewed & tested by the community

#3 Works good

a.milkovsky’s picture

Issue tags: -colorbox
ajFernandez’s picture

#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.

SocialNicheGuru’s picture

  • ilchovuchkov committed 66607bb on 7.x-1.x
    Issue #2459221 by cejams, amilkovsky, ilchovuchkov: Attach behaviors...
vuil’s picture

vuil’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

vuil’s picture