MCPcopy
hub / github.com/wellsjo/JSON-Splora / removeTab

Method removeTab

app/js/Tabs.js:60–77  ·  view source on GitHub ↗

* Removes tab and cleans up any children * * @param {Element} tabEl The tab element to remove

(tabEl = this.activeTabEl)

Source from the content-addressed store, hash-verified

58 */
59
60 removeTab(tabEl = this.activeTabEl) {
61 if (this.tabs.length === 1) {
62 return
63 }
64
65 const tabIndex = tabEl.index()
66 const tabId = tabEl.remove().data('tab')
67
68 $(`#tab-${tabId}`).remove()
69 const removedTab = this.tabs.splice(tabIndex, 1)[0]
70 removedTab.destroy()
71
72 this.container.tabs('refresh')
73
74 if (this.tabs.length === 1) {
75 this.hideTabBar()
76 }
77 }
78
79 /**
80 * Adds a new tab

Callers 2

newTabMethod · 0.95
createTemplateMethod · 0.80

Calls 2

hideTabBarMethod · 0.95
destroyMethod · 0.80

Tested by

no test coverage detected