This commit is contained in:
zadam
2020-02-08 20:53:07 +01:00
parent 08687b76ea
commit 18ee239362
8 changed files with 23 additions and 36 deletions

View File

@@ -8,6 +8,10 @@ export default class TabCachingWidget extends TabAwareWidget {
this.widgets = {};
}
async isEnabled() {
return this.tabContext.isActive();
}
doRender() {
this.$widget = $(`<div class="marker" style="display: none;">`);
return this.$widget;
@@ -53,9 +57,12 @@ export default class TabCachingWidget extends TabAwareWidget {
}
}
toggle(show) {
async toggle(show) {
for (const tabId in this.widgets) {
this.widgets[tabId].toggle(show && this.tabContext && tabId === this.tabContext.tabId);
this.widgets[tabId].toggle(
show
&& this.tabContext && tabId === this.tabContext.tabId
&& await this.widgets[tabId].isEnabled());
}
}
}