You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
xshop/resources/views/segments/menu/AplMenu/AplMenu.js

15 lines
490 B
JavaScript

const toggleSideMenu = function (e) {
e.preventDefault();
let txt = '<ul>';
document.querySelectorAll('#AplMenu > ul > li').forEach(function (el) {
if(!el.classList.contains('icon-menu')){
txt += el.outerHTML;
}
});
txt += '</ul>';
document.querySelector('#reps-menu').innerHTML = txt;
};
document.addEventListener('DOMContentLoaded',function () {
document.querySelector('#toggler-menu').addEventListener('click',toggleSideMenu);
});