New Font, Refactor of Layout, Expanded <link> Tags on search

This commit is contained in:
Simon Martens
2022-11-10 01:56:00 +01:00
parent e97103e7d9
commit 4f3581ee6a
36 changed files with 185 additions and 148 deletions

View File

@@ -51,16 +51,28 @@ const markactive_menu = function (element) {
var all_links = element.getElementsByTagName("a"),
i = 0,
len = all_links.length,
marked = false,
full_path = location.href.split("#")[0].toLowerCase(); //Ignore hashes
full_path = full_path.split("?")[0];
full_path = full_path.split("?")[0];
for (; i < len; i++) {
if (all_links[i].parentNode.classList.contains("ha-topnav-dropdown")) {
if (full_path.startsWith(all_links[i].href.toLowerCase())) {
all_links[i].className += " active";
all_links[i].className += " active pointer-events-none";
marked = true;
}
} else {
if (full_path == all_links[i].href.toLowerCase() || full_path == all_links[i].href.toLowerCase() + "/") {
all_links[i].className += " active pointer-events-none";
marked = true;
}
}
}
i = 0;
if (marked === false) {
for (; i < len; i++) {
if (all_links[i].classList.contains("ha-active-default")) {
all_links[i].className += " active";
}
}