tab bar is automatically hidden for only one tab

This commit is contained in:
zadam
2019-05-07 22:14:35 +02:00
parent 4ea27e604f
commit bfc61f8b36
5 changed files with 20 additions and 3 deletions

View File

@@ -69,6 +69,7 @@
this.setupEvents()
this.layoutTabs()
this.setupDraggabilly()
this.setVisibility()
}
emit(eventName, data) {
@@ -93,6 +94,10 @@
this.tabEls.forEach((tabEl) => this.setTabCloseEventListener(tabEl))
}
setVisibility() {
this.el.style.display = this.tabEls.length > 1 ? "block" : "none";
}
get tabEls() {
return Array.prototype.slice.call(this.el.querySelectorAll('.chrome-tab'))
}
@@ -191,6 +196,7 @@
tabProperties = Object.assign({}, defaultTapProperties, tabProperties)
this.tabContentEl.appendChild(tabEl)
this.setVisibility()
this.setTabCloseEventListener(tabEl)
this.updateTab(tabEl, tabProperties)
this.emit('tabAdd', { tabEl })
@@ -275,6 +281,7 @@
this.cleanUpPreviouslyDraggedTabs()
this.layoutTabs()
this.setupDraggabilly()
this.setVisibility()
}
removeAllTabsExceptForThis(remainingTabEl) {