From 89696a2f526e3a3f31e24a4d246c0c2ac01ca346 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Tue, 16 Apr 2019 13:33:05 -0400 Subject: [PATCH] Add body class when dialog is open This should make it easier for reacting to the presence of a dialog with css. --- js/Common.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/Common.js b/js/Common.js index 6a06cff714..e2714c33b0 100644 --- a/js/Common.js +++ b/js/Common.js @@ -927,6 +927,7 @@ if (!CRM.vars) CRM.vars = {}; }) .on('dialogopen', function(e) { var $el = $(e.target); + $('body').addClass('ui-dialog-open'); // Modal dialogs should disable scrollbars if ($el.dialog('option', 'modal')) { $el.addClass('modal-dialog'); @@ -961,6 +962,9 @@ if (!CRM.vars) CRM.vars = {}; if ($('.ui-dialog .modal-dialog:visible').not(e.target).length < 1) { $('body').css({overflow: ''}); } + if ($('.ui-dialog-content:visible').not(e.target).length < 1) { + $('body').removeClass('ui-dialog-open'); + } }) .on('submit', function(e) { // CRM-14353 - disable changes warn when submitting a form -- 2.25.1