MCPcopy Index your code
hub / github.com/nodejs/node / addMode

Method addMode

deps/v8/tools/profview/profview.js:1241–1254  ·  view source on GitHub ↗
(id, text, active)

Source from the content-addressed store, hash-verified

1239 let modeBar = this.element = $("mode-bar");
1240
1241 function addMode(id, text, active) {
1242 let div = document.createElement("div");
1243 div.classList = "mode-button" + (active ? " active-mode-button" : "");
1244 div.id = "mode-" + id;
1245 div.textContent = text;
1246 div.onclick = () => {
1247 if (main.currentState.mode === id) return;
1248 let old = $("mode-" + main.currentState.mode);
1249 old.classList = "mode-button";
1250 div.classList = "mode-button active-mode-button";
1251 main.setMode(id);
1252 };
1253 modeBar.appendChild(div);
1254 }
1255
1256 addMode("summary", "Summary", true);
1257 addMode("bottom-up", "Bottom up");

Callers

nothing calls this directly

Calls 2

createElementMethod · 0.80
$Function · 0.70

Tested by

no test coverage detected