Skip to content

Commit

Permalink
Refactor sidebar initialization in DoubleSidebar and SingleSidebar co…
Browse files Browse the repository at this point in the history
…mponents
  • Loading branch information
Adammatthiesen committed Dec 22, 2024
1 parent 9c21eec commit c2aca70
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ const t = useTranslations(lang, '@studiocms/dashboard:sidebar');
sidebarLinks();

document.addEventListener('astro:page-load', () => {
new DoubleSidebarHelper();
if (document.getElementById('sui-sidebars')) {
new DoubleSidebarHelper();
}
new DropdownHelper('sidebar-user-dropdown', true);
sidebarLinks();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ const t = useTranslations(lang, '@studiocms/dashboard:sidebar');
sidebarLinks();

document.addEventListener('astro:page-load', () => {
new SingleSidebarHelper('nav-toggle');
if (document.getElementById('sui-sidebar')) {
new SingleSidebarHelper('nav-toggle');
}
new DropdownHelper('sidebar-user-dropdown', true);
sidebarLinks();
});
Expand Down

0 comments on commit c2aca70

Please sign in to comment.