-
-
Notifications
You must be signed in to change notification settings - Fork 756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reinitialize Sidebar Component #257
Comments
Hi, can you clarify what you mean? I don't understand what you mean. Will a reusable function be created later? |
make Sidebar method as a global function like select2 or DataTable js plugin that can destroy and reinitialize |
Change window.sidebar = new Sidebar(sidebarEl) to window.Sidebar = Sidebar You can call it in the following way const sidebar = new window.Sidebar( document.getElementById("sidebar") ) |
Thanks mate this code is working 🔥 Current code window.Sidebar = Sidebar
if (sidebarEl) {
const sidebar = new window.Sidebar(sidebarEl)
} Found another bug : First initialize <ul class="submenu submenu-closed" style="--submenu-height: 86px;"> Second initialize <ul class="submenu submenu-closed"> My suggestion better implement destroy method too |
Fixed the bug, i'll update the code later |
Hi, can you make this one accessible to reinit the sidebar?
mazer/src/assets/static/js/components/sidebar.js
Line 258 in 94c8759
currently it only loads once, I want it to be able to be reinitialize when entering another page.
because there is an issue when build SPA application, which must be reinit again
The text was updated successfully, but these errors were encountered: