From 2aff1716b7099422582bc94e8a168ad3d02cfaa4 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 3 Nov 2014 20:32:48 -0500 Subject: [PATCH] CRM-15346 - pass more specific context to Drupal.behaviors --- js/crm.drupal.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/crm.drupal.js b/js/crm.drupal.js index 7699e6e9d9..fc0411aed2 100644 --- a/js/crm.drupal.js +++ b/js/crm.drupal.js @@ -1,12 +1,12 @@ // http://civicrm.org/licensing CRM.$(function($) { $(document) - .on('crmLoad', function() { + .on('crmLoad', function(e) { // This is drupal's old-school way of listening for 'load' type events. It has to be called manually. - Drupal.attachBehaviors(this); + Drupal.attachBehaviors(e.target); }) - .on('crmUnload', function() { - Drupal.detachBehaviors(this); + .on('crmUnload', function(e) { + Drupal.detachBehaviors(e.target); }) .on('dialogopen', function(e) { // D7 hack to get the toolbar out of the way (CRM-15341) -- 2.25.1