MCPcopy Create free account
hub / github.com/nodejs/node / addTabAndContent

Method addTabAndContent

deps/v8/tools/turbolizer/src/tabs.ts:36–50  ·  view source on GitHub ↗
(caption: string)

Source from the content-addressed store, hash-verified

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");

Callers 2

loadFileFunction · 0.80

Calls 3

addTabMethod · 0.95
createElementMethod · 0.80
bindMethod · 0.45

Tested by

no test coverage detected