REFACTOR removing useless code
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
e6d2ca7023
commit
9cda664791
|
|
@ -1,29 +0,0 @@
|
||||||
document.addEventListener("DOMContentLoaded", function () {
|
|
||||||
const toolbar = document.querySelector("#press-toolbar");
|
|
||||||
if (!toolbar) return;
|
|
||||||
const toolbarButtons = toolbar.querySelectorAll("button");
|
|
||||||
const ressourcesGridContentWrapper = document.querySelector(
|
|
||||||
".ressources-grid-content-wrapper"
|
|
||||||
);
|
|
||||||
|
|
||||||
function setActiveTab(currentButton) {
|
|
||||||
toolbarButtons.forEach((button) => {
|
|
||||||
button.setAttribute("aria-selected", "false");
|
|
||||||
});
|
|
||||||
|
|
||||||
currentButton.setAttribute("aria-selected", "true");
|
|
||||||
ressourcesGridContentWrapper.setAttribute(
|
|
||||||
"data-active-tab",
|
|
||||||
currentButton.getAttribute("data-tab")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function initToolbar() {
|
|
||||||
toolbarButtons.forEach((button) => {
|
|
||||||
button.addEventListener("click", function () {
|
|
||||||
setActiveTab(button);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
initToolbar();
|
|
||||||
});
|
|
||||||
Loading…
Reference in New Issue
Block a user