projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
CRM-16142 - Variable scope fixes
[civicrm-core.git]
/
js
/
crm.drupal.js
diff --git
a/js/crm.drupal.js
b/js/crm.drupal.js
index 0d8dadcf9e423416e3f60c60b099d597f81c522c..32ed437423d3933cb60c5b2753285bfd55a80931 100644
(file)
--- a/
js/crm.drupal.js
+++ b/
js/crm.drupal.js
@@
-1,9
+1,15
@@
// http://civicrm.org/licensing
CRM.$(function($) {
$(document)
// 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.
// 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(e) {
+ // This function doesn't exist in D6 so call conditionally
+ if (typeof Drupal.detachBehaviors === 'function') {
+ Drupal.detachBehaviors(e.target);
+ }
})
.on('dialogopen', function(e) {
// D7 hack to get the toolbar out of the way (CRM-15341)
})
.on('dialogopen', function(e) {
// D7 hack to get the toolbar out of the way (CRM-15341)
@@
-14,5
+20,5
@@
CRM.$(function($) {
// D7 hack, restore toolbar position (CRM-15341)
$('#toolbar').css('z-index', '');
}
// D7 hack, restore toolbar position (CRM-15341)
$('#toolbar').css('z-index', '');
}
- })
+ })
;
});
});