Skip to content

Commit

Permalink
[UPDT] PMS: Feedback overview
Browse files Browse the repository at this point in the history
  • Loading branch information
horilla-opensource committed Sep 19, 2024
1 parent d479dee commit f758d5f
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,40 @@
$("title").html("{{white_label_company_name}} | " + secondsToDuration(at_work_seconds));
}
}, 1000);

function switchTab(e) {
let parentContainerEl = e.target.closest(".oh-tabs");
let tabElement = e.target.closest(".oh-tabs__tab");


let targetSelector = e.target.dataset.target;
let targetEl = parentContainerEl
? parentContainerEl.querySelector(targetSelector)
: null;

// Highlight active tabs
if (tabElement && !tabElement.classList.contains("oh-tabs__tab--active")) {
parentContainerEl
.querySelectorAll(".oh-tabs__tab--active")
.forEach(function (item) {
item.classList.remove("oh-tabs__tab--active");
});

if (!tabElement.classList.contains("oh-tabs__new-tab")) {
tabElement.classList.add("oh-tabs__tab--active");
}
}

// Switch tabs
if (targetEl && !targetEl.classList.contains("oh-tabs__content--active")) {
parentContainerEl
.querySelectorAll(".oh-tabs__content--active")
.forEach(function (item) {
item.classList.remove("oh-tabs__content--active");
});
targetEl.classList.add("oh-tabs__content--active");
}
}
</script>
{% endif %}
</body>
Expand Down

0 comments on commit f758d5f

Please sign in to comment.