diff --git a/static/script.js b/static/script.js index 548ccb1..2cd9490 100644 --- a/static/script.js +++ b/static/script.js @@ -2115,7 +2115,24 @@ function renderLineupRow(row) { `; } +document.addEventListener("click", async function (event) { + const tab = event.target.closest(".tab-link[data-vmix-title]"); + if (!tab) return; + event.preventDefault(); + + const title = String(tab.dataset.vmixTitle || "").trim(); + + try { + if (title) { + await sendDirectVmixCommands([ + vmixCmd(`Function=PreviewInput&Input=${encodeURIComponent(title)}`) + ]); + } + } finally { + window.location.href = tab.href; + } +}); function makeDraggable(el) {