After requesting content via AJAX, the response handler performs a Drupal.attachBehaviors() on the raw data returned from the AJAX request. Since this is a string and not a DOM object, the attachBehaviors is basically a no-op. This patch fixes that behavior. The method is similar to other modules, such as Views. It creates a jQuery object from the returned HTML string, inserts that into the DOM, then uses the objects parent as the context for the call to Drupal.attachBehaviors().

CommentFileSizeAuthor
esi-6x-attachBehaviors.patch355 bytesmgriego
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikeytown2’s picture

Status: Needs review » Fixed

Committed you patch

  • mikeytown2 committed 29e42ea on 6.x-2.x authored by mgriego
    Issue #2303199 by mgriego: AJAX method does not properly attach...

Status: Fixed » Closed (fixed)

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