From 3267f781b936545ac708f419adba0325300cddd2 Mon Sep 17 00:00:00 2001 From: Diego Smania Date: Fri, 17 Sep 2021 16:26:49 -0300 Subject: [PATCH] [build/js]: Fix height problem on default tabs for the IFrame plugin. (#3876) --- build/js/IFrame.js | 6 ++++-- build/js/Layout.js | 4 ++-- docs/javascript/iframe.md | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/build/js/IFrame.js b/build/js/IFrame.js index 2b1e1e7bb..9af4988ec 100644 --- a/build/js/IFrame.js +++ b/build/js/IFrame.js @@ -227,14 +227,16 @@ class IFrame { // Private _init() { - if ($(SELECTOR_TAB_CONTENT).children().length > 2) { + const usingDefTab = ($(SELECTOR_TAB_CONTENT).children().length > 2) + + if (usingDefTab) { const $el = $(`${SELECTOR_TAB_PANE}:first-child`) $el.show() this._setItemActive($el.find('iframe').attr('src')) } this._setupListeners() - this._fixHeight(true) + this._fixHeight(!usingDefTab) } _initFrameElement() { diff --git a/build/js/Layout.js b/build/js/Layout.js index fc3f45c79..0c14fd510 100644 --- a/build/js/Layout.js +++ b/build/js/Layout.js @@ -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.footer == 0 ? 0 : (heights.header - heights.footer))) + $contentSelector.css(this._config.panelAutoHeightMode, (max + offset) - heights.header - heights.footer) } else { - $contentSelector.css(this._config.panelAutoHeightMode, (max + offset) - (heights.footer == 0 ? 0 : heights.header)) + $contentSelector.css(this._config.panelAutoHeightMode, (max + offset) - heights.header) } if (this._isFooterFixed()) { diff --git a/docs/javascript/iframe.md b/docs/javascript/iframe.md index 7bf5b9fc7..0a942f886 100644 --- a/docs/javascript/iframe.md +++ b/docs/javascript/iframe.md @@ -43,7 +43,9 @@ To get the iframe 100% working you need the following content-wrapper markup:
-
+
+ +

No tab selected!