Only disable the sibling tabs when a particular tab is selected. This allows the 'tab' management code to be reused for nested tabs

This commit is contained in:
cmdr2 2023-02-06 13:46:40 +05:30
parent 368967fbcf
commit ded6a41f86

View File

@ -1445,7 +1445,7 @@ function selectTab(tab_id) {
let tabInfo = tabElements.find(t => t.tab.id == tab_id)
if (!tabInfo.tab.classList.contains("active")) {
tabElements.forEach(info => {
if (info.tab.classList.contains("active")) {
if (info.tab.classList.contains("active") && info.tab.parentNode === tabInfo.tab.parentNode) {
info.tab.classList.toggle("active")
info.content.classList.toggle("active")
}