Skip to content

Commit

Permalink
Fix tabFunctionality JS function to open the first tab in case there …
Browse files Browse the repository at this point in the history
…is a cookie with a tab ID not in the page.
  • Loading branch information
atteggiani committed Sep 19, 2024
1 parent db08863 commit 8c568c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/js/miscellaneous.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function tabFunctionality() {
let label = tabLabels.getAttribute("label");
let tabID;
if (sessionStorage.getItem(`tabs-label=${label}`)) {
tabID = sessionStorage.getItem(`tabs-label=${label}`);
tabID = document.getElementById(tabID) ? sessionStorage.getItem(`tabs-label=${label}`) : tabLabels.firstElementChild.id;
} else if (tabLabels.querySelector(".activeTab")) {
tabID = tabLabels.querySelector(".activeTab").id;
} else {
Expand Down

0 comments on commit 8c568c4

Please sign in to comment.