From: Coleman Watts Date: Fri, 3 Jul 2015 13:28:41 +0000 (-0400) Subject: CRM-16795 - Fix z-index conflict btw WP admin bar and popups X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=469d8da;p=civicrm-core.git CRM-16795 - Fix z-index conflict btw WP admin bar and popups --- diff --git a/CRM/Utils/System/WordPress.php b/CRM/Utils/System/WordPress.php index 35739d2e4f..277eda2472 100644 --- a/CRM/Utils/System/WordPress.php +++ b/CRM/Utils/System/WordPress.php @@ -627,4 +627,11 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { } } + /** + * Append WP js to coreResourcesList. + */ + public function appendCoreResources(&$list) { + $list[] = 'js/crm.wordpress.js'; + } + } diff --git a/js/crm.wordpress.js b/js/crm.wordpress.js new file mode 100644 index 0000000000..6ca4ff504d --- /dev/null +++ b/js/crm.wordpress.js @@ -0,0 +1,14 @@ +// http://civicrm.org/licensing +CRM.$(function($) { + $(document) + .on('dialogopen', function(e) { + // Make admin bar hide behind popup windows + $('#adminmenuwrap').css('z-index', '100'); + }) + .on('dialogclose', function(e) { + if ($('.ui-dialog-content:visible').not(e.target).length < 1) { + // Restore admin bar position + $('#adminmenuwrap').css('z-index', ''); + } + }); +});