From aee119c71189a1f4a8ca70a4eef5100e105b15bd Mon Sep 17 00:00:00 2001 From: AlphaX-Projects <77661270+AlphaX-Projects@users.noreply.github.com> Date: Fri, 16 Jun 2023 10:13:33 +0200 Subject: [PATCH] when click close on last tab it make the left one active --- core/src/components/show-plugin.js | 139 +++++++++++++++++++++++------ 1 file changed, 110 insertions(+), 29 deletions(-) diff --git a/core/src/components/show-plugin.js b/core/src/components/show-plugin.js index 61b583ab..27e0f219 100644 --- a/core/src/components/show-plugin.js +++ b/core/src/components/show-plugin.js @@ -260,23 +260,6 @@ class ShowPlugin extends connect(store)(LitElement) { this.chatHeads = [] } - async getUpdateComplete() { - await super.getUpdateComplete() - return true - } - - async addTab(tab) { - this.tabs = [...this.tabs, tab] - await this.getUpdateComplete() - - // add the new tab to the tabs array - const newIndex = this.tabs.length - 1 - - // render the tab and wait for it to be added to the DOM - const frame = this.shadowRoot.getElementById(`showPluginFrame${newIndex}`) - this.createEpmlInstance(frame, newIndex) - } - render() { const plugSrc = (myPlug) => { return myPlug === undefined ? 'about:blank' : `${window.location.origin}/plugin/${myPlug.domain}/${myPlug.page}${this.linkParam}` @@ -331,20 +314,21 @@ class ShowPlugin extends connect(store)(LitElement) { return html`
-
+
${icon}
${count ? html` ${title} ${count} - {this.removeTab(index)}}>X + {this.removeTab(index, tab.id)}}>X ` : html` ${title} - {this.removeTab(index)}}>X + {this.removeTab(index, tab.id)}}>X `}
@@ -367,7 +351,7 @@ class ShowPlugin extends connect(store)(LitElement) {
${repeat(this.tabs, (tab) => tab.id, (tab, index) => html` -
+