MCPcopy Create free account
hub / github.com/easydiffusion/easydiffusion / selectTab

Function selectTab

ui/media/js/main.js:2602–2615  ·  view source on GitHub ↗
(tab_id)

Source from the content-addressed store, hash-verified

2600
2601var tabElements = []
2602function selectTab(tab_id) {
2603 let tabInfo = tabElements.find((t) => t.tab.id == tab_id)
2604 if (!tabInfo.tab.classList.contains("active")) {
2605 tabElements.forEach((info) => {
2606 if (info.tab.classList.contains("active") && info.tab.parentNode === tabInfo.tab.parentNode) {
2607 info.tab.classList.toggle("active")
2608 info.content.classList.toggle("active")
2609 }
2610 })
2611 tabInfo.tab.classList.toggle("active")
2612 tabInfo.content.classList.toggle("active")
2613 }
2614 document.dispatchEvent(new CustomEvent("tabClick", { detail: tabInfo }))
2615}
2616function linkTabContents(tab) {
2617 var name = tab.id.replace("tab-", "")
2618 var content = document.getElementById(`tab-content-${name}`)

Callers 1

linkTabContentsFunction · 0.85

Calls 1

dispatchEventMethod · 0.45

Tested by

no test coverage detected