mirror of
https://github.com/Theodor-Springmann-Stiftung/hamann-ausgabe-core.git
synced 2025-10-29 17:25:32 +00:00
New Font, Refactor of Layout, Expanded <link> Tags on search
This commit is contained in:
@@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user