From: Coleman Watts Date: Fri, 26 Sep 2014 17:09:19 +0000 (-0400) Subject: CRM-15341 - move cms-specific code to appropriate file X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=63b128df3fffd5bc92894372b716845cb41980e3;p=civicrm-core.git CRM-15341 - move cms-specific code to appropriate file --- diff --git a/js/Common.js b/js/Common.js index db365f3bb9..2758eb91ba 100644 --- a/js/Common.js +++ b/js/Common.js @@ -553,15 +553,11 @@ CRM.strings = CRM.strings || {}; e.preventDefault(); }); } - // FIXME: D7 hack to get the toolbar out of the way (CRM-15341) - if (CRM.config.userFramework === 'Drupal') $('#toolbar').css('z-index', '100'); }) .on('dialogclose', function(e) { // Restore scrollbars when closing modal if ($('.ui-dialog .modal-dialog:visible').not(e.target).length < 1) { $('body').css({overflow: ''}); - // FIXME: D7 hack, restore toolbar (CRM-15341) - if (CRM.config.userFramework === 'Drupal') $('#toolbar').css('z-index', ''); } }) .on('submit', function(e) { diff --git a/js/crm.drupal.js b/js/crm.drupal.js index 0e352f996a..0d8dadcf9e 100644 --- a/js/crm.drupal.js +++ b/js/crm.drupal.js @@ -1,7 +1,18 @@ // http://civicrm.org/licensing CRM.$(function($) { - $(document).on('crmLoad', function() { - // This is drupal's old-school way of listening for 'load' type events. It has to be called manually. - Drupal.attachBehaviors(this); - }); + $(document) + .on('crmLoad', function() { + // This is drupal's old-school way of listening for 'load' type events. It has to be called manually. + Drupal.attachBehaviors(this); + }) + .on('dialogopen', function(e) { + // D7 hack to get the toolbar out of the way (CRM-15341) + $('#toolbar').css('z-index', '100'); + }) + .on('dialogclose', function(e) { + if ($('.ui-dialog-content:visible').not(e.target).length < 1) { + // D7 hack, restore toolbar position (CRM-15341) + $('#toolbar').css('z-index', ''); + } + }) });