Mobile-friendly Menu UI
This commit is contained in:
parent
1a47e8143a
commit
1193d70d90
5 changed files with 135 additions and 20 deletions
|
|
@ -1,7 +1,23 @@
|
|||
$(document).ready(function () {
|
||||
$('.dropdown-submenu a.test').on("click", function (e) {
|
||||
$(this).next('ul').toggle();
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
const toggleSubMenu = (el) => {
|
||||
$(`[for="${el.getAttribute("from")}"`).toggle("slide", "down");
|
||||
|
||||
// TODO: do something with these
|
||||
};
|
||||
|
||||
const toggleMenu = () => {
|
||||
$(".mobile-menu").toggle("slide", "left");
|
||||
};
|
||||
|
||||
$(document).ready(() => {
|
||||
document.querySelectorAll(".compact.submenu.item").forEach((el) => {
|
||||
let id = `subMenu_${new Date().getMilliseconds()}`;
|
||||
el.setAttribute("from", id);
|
||||
|
||||
el.querySelectorAll(".compact.sub.item").forEach((child) => {
|
||||
child.setAttribute("for", id);
|
||||
child.style.display = "none";
|
||||
child.textContent = `${child.textContent}`;
|
||||
el.parentElement.appendChild(child);
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue