mirror of
https://github.com/imfing/hextra.git
synced 2025-06-19 23:01:19 -04:00
feat: implement collapsible sidebar
chore: basic sidebar toggle button chore: update compiled css
This commit is contained in:
12
assets/js/sidebar.js
Normal file
12
assets/js/sidebar.js
Normal file
@ -0,0 +1,12 @@
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const buttons = document.querySelectorAll(".hextra-sidebar-collapsible-button");
|
||||
buttons.forEach(function (button) {
|
||||
button.addEventListener("click", function (e) {
|
||||
e.preventDefault();
|
||||
const list = button.parentElement.parentElement;
|
||||
if (list) {
|
||||
list.classList.toggle("open")
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user