From 4a2a28f799146867c6b0717936cb14de082e9792 Mon Sep 17 00:00:00 2001 From: REJack Date: Mon, 12 Jul 2021 21:59:23 +0200 Subject: [PATCH] fix height bug w/o footer --- build/js/Layout.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/js/Layout.js b/build/js/Layout.js index c811f1034..fc3f45c79 100644 --- a/build/js/Layout.js +++ b/build/js/Layout.js @@ -67,7 +67,7 @@ class Layout { const heights = { window: $(window).height(), - header: $(SELECTOR_HEADER).length > 0 ? $(SELECTOR_HEADER).outerHeight() : 0, + header: $(SELECTOR_HEADER).length > 0 && !$('body').hasClass('layout-navbar-fixed') ? $(SELECTOR_HEADER).outerHeight() : 0, footer: $(SELECTOR_FOOTER).length > 0 ? $(SELECTOR_FOOTER).outerHeight() : 0, sidebar: $(SELECTOR_SIDEBAR).length > 0 ? $(SELECTOR_SIDEBAR).height() : 0, controlSidebar @@ -86,9 +86,9 @@ class Layout { if (max === heights.controlSidebar) { $contentSelector.css(this._config.panelAutoHeightMode, (max + offset)) } else if (max === heights.window) { - $contentSelector.css(this._config.panelAutoHeightMode, (max + offset) - heights.header - heights.footer) + $contentSelector.css(this._config.panelAutoHeightMode, (max + offset) - (heights.footer == 0 ? 0 : (heights.header - heights.footer))) } else { - $contentSelector.css(this._config.panelAutoHeightMode, (max + offset) - heights.header) + $contentSelector.css(this._config.panelAutoHeightMode, (max + offset) - (heights.footer == 0 ? 0 : heights.header)) } if (this._isFooterFixed()) {