From: Coleman Watts Date: Tue, 16 Apr 2019 17:36:32 +0000 (-0400) Subject: Correctly size UI dialog accounting for height of menubar X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=59007035ed1e01cbba5f84bbe7325a362d1fe3fe;p=civicrm-core.git Correctly size UI dialog accounting for height of menubar --- diff --git a/js/Common.js b/js/Common.js index e2714c33b0..1dee5a526a 100644 --- a/js/Common.js +++ b/js/Common.js @@ -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'), diff --git a/js/crm.ajax.js b/js/crm.ajax.js index 5a1155c846..23be078e8b 100644 --- a/js/crm.ajax.js +++ b/js/crm.ajax.js @@ -572,8 +572,11 @@ 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', {