From 8196efdc5eea18377f2aac4d25d7fd6802a10bb5 Mon Sep 17 00:00:00 2001 From: REJack Date: Thu, 26 Nov 2020 15:39:31 +0100 Subject: [PATCH] fix min-height calculation with controlSidebar --- build/js/Layout.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build/js/Layout.js b/build/js/Layout.js index 09609820f..8381b8cd9 100644 --- a/build/js/Layout.js +++ b/build/js/Layout.js @@ -61,7 +61,7 @@ class Layout { let controlSidebar = 0 if ($body.hasClass(CLASS_NAME_CONTROL_SIDEBAR_SLIDE_OPEN) || $body.hasClass(CLASS_NAME_CONTROL_SIDEBAR_OPEN) || extra === 'control_sidebar') { - controlSidebar = $(SELECTOR_CONTROL_SIDEBAR_CONTENT).height() + controlSidebar = $(SELECTOR_CONTROL_SIDEBAR_CONTENT).outerHeight() } const heights = { @@ -84,7 +84,7 @@ class Layout { if (offset !== false) { if (max === heights.controlSidebar) { if ($body.hasClass(CLASS_NAME_LAYOUT_TOP_NAV)) { - $contentSelector.css(this._config.panelAutoHeightMode, (max + offset) + heights.header + heights.footer) + $contentSelector.css(this._config.panelAutoHeightMode, (max + offset) - heights.header - heights.footer) } else { $contentSelector.css(this._config.panelAutoHeightMode, (max + offset)) } @@ -94,6 +94,10 @@ class Layout { $contentSelector.css(this._config.panelAutoHeightMode, (max + offset) - heights.header) } + if (heights.controlSidebar + heights.footer >= heights.sidebar && heights.controlSidebar != 0) { + $contentSelector.css(this._config.panelAutoHeightMode, (heights.controlSidebar + offset)) + } + if (this._isFooterFixed()) { $contentSelector.css(this._config.panelAutoHeightMode, parseFloat($contentSelector.css(this._config.panelAutoHeightMode)) + heights.footer) }