Fix mobile menu friendliness!
This commit is contained in:
parent
9333e5a14d
commit
3ba38ee3b7
7 changed files with 29 additions and 5 deletions
|
|
@ -47,10 +47,18 @@ window.addEventListener("DOMContentLoaded", (evt) => {
|
|||
let id = `subMenu_${new Date().getMilliseconds()}`;
|
||||
el.setAttribute("from", id);
|
||||
|
||||
let subMenuItems = [];
|
||||
|
||||
el.querySelectorAll(".compact.sub.item").forEach((child) => {
|
||||
subMenuItems.push(child);
|
||||
});
|
||||
|
||||
subMenuItems.reverse();
|
||||
|
||||
subMenuItems.forEach((child) => {
|
||||
child.setAttribute("for", id);
|
||||
child.textContent = `${child.textContent}`;
|
||||
el.parentElement.appendChild(child);
|
||||
el.parentElement.insertBefore(child, el.nextSibling);
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue