mirror of https://github.com/4xmen/xshop.git
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.
19 lines
621 B
JavaScript
19 lines
621 B
JavaScript
window.addEventListener('load', function () {
|
|
try {
|
|
|
|
document.querySelectorAll('#panel-navbar a')?.forEach(function (el) {
|
|
el.addEventListener('click', function (e) {
|
|
const href = this.getAttribute('href');
|
|
if (href[0] === '#'){
|
|
e.preventDefault();
|
|
document.querySelector('#panel').classList.add('sided');
|
|
document.querySelector('#sidebar-panel').innerHTML = document.querySelector(href).outerHTML;
|
|
}
|
|
});
|
|
})
|
|
} catch (e) {
|
|
console.log(e.message);
|
|
}
|
|
|
|
});
|