From f545979c6412f71002e7f1061817bfba3e995464 Mon Sep 17 00:00:00 2001 From: REJack Date: Sat, 18 Sep 2021 01:28:18 +0200 Subject: [PATCH] fix iframe plugin for default tabs --- build/js/IFrame.js | 18 +++++++++++------- build/scss/pages/_iframe.scss | 8 ++++++++ index.html | 2 +- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/build/js/IFrame.js b/build/js/IFrame.js index 4a587102f..eef13f10a 100644 --- a/build/js/IFrame.js +++ b/build/js/IFrame.js @@ -253,14 +253,18 @@ class IFrame { _init() { 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(!usingDefTab) + this._fixHeight(true) + + if (usingDefTab) { + const $el = $(`${SELECTOR_TAB_PANE}`).first() + // eslint-disable-next-line no-console + console.log($el) + const uniqueName = $el.attr('id').replace('panel-', '') + const navId = `#tab-${uniqueName}` + + this.switchTab(navId, true) + } } _initFrameElement() { diff --git a/build/scss/pages/_iframe.scss b/build/scss/pages/_iframe.scss index 93eb55a27..54d80cd07 100644 --- a/build/scss/pages/_iframe.scss +++ b/build/scss/pages/_iframe.scss @@ -132,3 +132,11 @@ body.iframe-mode-fullscreen { opacity: 1; } } + +@include dark-mode () { + .content-wrapper.iframe-mode { + .tab-loading { + background-color: $dark; + } + } +} diff --git a/index.html b/index.html index a1409de20..183456367 100644 --- a/index.html +++ b/index.html @@ -164,7 +164,7 @@