diff --git a/client/src/ui.js b/client/src/ui.js index c2be9fe442..e43a879a5c 100644 --- a/client/src/ui.js +++ b/client/src/ui.js @@ -139,6 +139,11 @@ Espo.define('ui', [], function () { this.$el.on('shown.bs.modal', function (e) { $('.modal-backdrop').not('.stacked').addClass('stacked'); + var headerHeight = this.$el.find('header.modal-header').outerHeight(); + var footerHeight = this.$el.find('footer.modal-footer').outerHeight(); + + var diffHeight = headerHeight + footerHeight + options.modalBodyDiffHeight; + if (this.fitHeight) { var processResize = function () { var windowHeight = $window.height(); @@ -150,7 +155,7 @@ Espo.define('ui', [], function () { return; } this.$el.find('div.modal-body').css({ - 'maxHeight': (windowHeight - 192) + 'px', + 'maxHeight': (windowHeight - diffHeight) + 'px', 'overflow': 'auto' }); }.bind(this); diff --git a/client/src/views/modal.js b/client/src/views/modal.js index d960c9001f..dd82622966 100644 --- a/client/src/views/modal.js +++ b/client/src/views/modal.js @@ -142,6 +142,7 @@ Espo.define('views/modal', 'view', function (Dep) { fitHeight: this.fitHeight, draggable: this.isDraggable, className: this.className, + modalBodyDiffHeight: this.getThemeManager().getParam('modalBodyDiffHeight') || 92, onRemove: function () { this.onDialogClose(); }.bind(this)