Skip to content

Commit f758d5f

Browse files
[UPDT] PMS: Feedback overview
1 parent d479dee commit f758d5f

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

templates/index.html

+34
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,40 @@
383383
$("title").html("{{white_label_company_name}} | " + secondsToDuration(at_work_seconds));
384384
}
385385
}, 1000);
386+
387+
function switchTab(e) {
388+
let parentContainerEl = e.target.closest(".oh-tabs");
389+
let tabElement = e.target.closest(".oh-tabs__tab");
390+
391+
392+
let targetSelector = e.target.dataset.target;
393+
let targetEl = parentContainerEl
394+
? parentContainerEl.querySelector(targetSelector)
395+
: null;
396+
397+
// Highlight active tabs
398+
if (tabElement && !tabElement.classList.contains("oh-tabs__tab--active")) {
399+
parentContainerEl
400+
.querySelectorAll(".oh-tabs__tab--active")
401+
.forEach(function (item) {
402+
item.classList.remove("oh-tabs__tab--active");
403+
});
404+
405+
if (!tabElement.classList.contains("oh-tabs__new-tab")) {
406+
tabElement.classList.add("oh-tabs__tab--active");
407+
}
408+
}
409+
410+
// Switch tabs
411+
if (targetEl && !targetEl.classList.contains("oh-tabs__content--active")) {
412+
parentContainerEl
413+
.querySelectorAll(".oh-tabs__content--active")
414+
.forEach(function (item) {
415+
item.classList.remove("oh-tabs__content--active");
416+
});
417+
targetEl.classList.add("oh-tabs__content--active");
418+
}
419+
}
386420
</script>
387421
{% endif %}
388422
</body>

0 commit comments

Comments
 (0)