@n8d/htwoo-core
Version:
hTWOo is a Fluent Design Framework purely in HTML and CSS
2 lines (1 loc) • 872 B
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).htwoo=e.htwoo||{},e.htwoo.nav={}))}(this,(function(e){"use strict";const t=e=>{console.log(e);let t=e.target.closest(".hoo-navitem");console.log(t),console.log(t.getAttribute("aria-expanded")),console.log(typeof t.getAttribute("aria-expanded")),console.log(" LOOMA ::: ",t.getAttribute("aria-expanded"),Boolean(t.getAttribute("aria-expanded")),!0===Boolean(t.getAttribute("aria-expanded"))),"true"===t.getAttribute("aria-expanded")?t.setAttribute("aria-expanded",!1):t.setAttribute("aria-expanded",!0)};e.initMenu=()=>{document.querySelectorAll(".hoo-navitem[aria-expanded]").forEach((e=>{e.addEventListener("click",t)}))},Object.defineProperty(e,"__esModule",{value:!0})}));