(caption: string)
| 34 | } |
| 35 | |
| 36 | public addTabAndContent(caption: string): [HTMLLIElement, HTMLDivElement] { |
| 37 | const contentDiv = document.createElement("div"); |
| 38 | contentDiv.className = "tab-content tab-default"; |
| 39 | contentDiv.id = `tab-content-${this.container.id}-${this.nextTabId++}`; |
| 40 | contentDiv.style.display = "none"; |
| 41 | this.container.appendChild(contentDiv); |
| 42 | |
| 43 | const newTab = this.addTab(caption); |
| 44 | newTab.dataset.divid = contentDiv.id; |
| 45 | newTab.draggable = true; |
| 46 | newTab.ondragstart = this.tabOnDragStart.bind(this); |
| 47 | const lastTab = this.tabBar.querySelector("li.last-tab"); |
| 48 | this.tabBar.insertBefore(newTab, lastTab); |
| 49 | return [newTab, contentDiv]; |
| 50 | } |
| 51 | |
| 52 | public addTab(caption: string): HTMLLIElement { |
| 53 | const newTab = document.createElement("li"); |
no test coverage detected