Added mechanism to hide tabs

This commit is contained in:
mathis_s committed 2026-09-02 10:34:11 +02:00
1 parent a890b2562d
commit 76ee9f8ff9
1 file changed
+26 -22
+26 -22
View File
@@ -227,29 +227,33 @@ function fillTabs() {
// tab counter
let iTab=0;
for (let key in instrTabs) {
iTab++;
let d = document.createElement("div");
d.id = "Tab" + iTab;
d.className = "tabcontent";
let f = "<iframe src='/tabs/" + instrTabs[key].htmlFile + "'style='height:500px;width:100%;' onload='this.before((this.contentDocument.body||this.contentDocument).children[0]);this.remove();'></iframe>";
d.innerHTML= f;
let b = document.createElement("button");
if (instrTabs[key].style == "Menu") {
if ('show' in instrTabs[key] && !instrTabs[key].show) {
continue; // skip this tab if show is false
}
iTab++;
let d = document.createElement("div");
d.id = "Tab" + iTab;
d.className = "tabcontent";
let f = "<iframe src='/tabs/" + instrTabs[key].htmlFile + "'style='height:500px;width:100%;' onload='this.before((this.contentDocument.body||this.contentDocument).children[0]);this.remove();'></iframe>";
d.innerHTML= f;
let b = document.createElement("button");
if (instrTabs[key].style == "Menu") {
b = document.createElement("a");
}
b.id = iTab;
b.className = "w3-bar-item w3-button w3-round";
b.setAttribute("onclick","openTab(event,this.id);" + instrTabs[key].addFunc);
b.innerHTML = "<b>" + instrTabs[key].label + "</b>";
//b.onload = "openTab(event,this.id);" + instrTabs[key].addFunc;
// Append elements
if (instrTabs[key].style == "Tab") {
tabBtns.insertBefore(b,beforeMenu);
} else {
tabMenu.insertBefore(b,HIPA);
}
tabFrames.appendChild(d);
}
b.id = iTab;
b.className = "w3-bar-item w3-button w3-round";
b.setAttribute("onclick","openTab(event,this.id);" + instrTabs[key].addFunc);
b.innerHTML = "<b>" + instrTabs[key].label + "</b>";
//b.onload = "openTab(event,this.id);" + instrTabs[key].addFunc;
// Append elements
if (instrTabs[key].style == "Tab") {
tabBtns.insertBefore(b,beforeMenu);
} else {
tabMenu.insertBefore(b,HIPA);
}
tabFrames.appendChild(d);
}
}