From 469d8dabca00eaf114bba0e83be6edbc27078372 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Fri, 3 Jul 2015 09:28:41 -0400 Subject: [PATCH] CRM-16795 - Fix z-index conflict btw WP admin bar and popups --- CRM/Utils/System/WordPress.php | 7 +++++++ js/crm.wordpress.js | 14 ++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 js/crm.wordpress.js 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', ''); + } + }); +}); -- 2.25.1