Correctly size UI dialog accounting for height of menubar
authorColeman Watts <coleman@civicrm.org>
Tue, 16 Apr 2019 17:36:32 +0000 (13:36 -0400)
committerColeman Watts <coleman@civicrm.org>
Tue, 16 Apr 2019 20:08:59 +0000 (16:08 -0400)
js/Common.js
js/crm.ajax.js

index e2714c33b0ec996c73f36f564639a5caed1b461b..1dee5a526a7798292b3c9968c26ea618d98c299f 100644 (file)
@@ -944,6 +944,9 @@ if (!CRM.vars) CRM.vars = {};
             $(this).button('option', 'icons', {primary: 'fa-expand'});
           } else {
             var menuHeight = $('#civicrm-menu').outerHeight();
+            if ($('body').hasClass('crm-menubar-below-cms-menu')) {
+              menuHeight += $('#civicrm-menu').offset().top;
+            }
             $el.data('origSize', {
               position: {my: 'center', at: 'center center+' + (menuHeight / 2), of: window},
               width: $el.dialog('option', 'width'),
index 5a1155c8462bd2a24a1e90d91eefc77628be87db..23be078e8b5af74a548cd9f2f87501d07fdeacaf 100644 (file)
           var currentHeight = $wrapper.outerHeight(),
             padding = currentHeight - $dialog.height(),
             newHeight = $dialog.prop('scrollHeight') + padding,
-            menuHeight = $('#civicrm-menu').outerHeight(),
-            maxHeight = $(window).height() - menuHeight;
+            menuHeight = $('#civicrm-menu').outerHeight();
+          if ($('body').hasClass('crm-menubar-below-cms-menu')) {
+            menuHeight += $('#civicrm-menu').offset().top;
+          }
+          var maxHeight = $(window).height() - menuHeight;
           newHeight = newHeight > maxHeight ? maxHeight : newHeight;
           if (newHeight > (currentHeight + 15)) {
             $dialog.dialog('option', {