refactor: remove unnecessary DOMContentLoaded wrappers
Since main.js has 'defer' attribute, the DOM is guaranteed to be ready when modules execute. These wrappers are unnecessary. dashboard.ts: - Removed DOMContentLoaded wrapper, code runs directly - Event delegation setup runs immediately custom-section-builder.ts: - Removed DOMContentLoaded wrapper - initCustomSectionBuilder() called directly toast.ts: - Removed DOMContentLoaded wrapper - initializeToastSystem() called directly at top level - Removed dead Alpine.data registration (unused) search.ts: - Removed DOMContentLoaded wrapper - initializeSearch exported for use in header theme.ts: - Removed DOMContentLoaded wrapper - Functions now exported for use in header Alpine component
This commit is contained in:
+2
-3
@@ -303,10 +303,9 @@ function selectLibraryAndBook(libraryId: string, bookId: string): void {
|
||||
hideSearchResults();
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", initializeSearch);
|
||||
|
||||
export { selectLibraryAndBook };
|
||||
export { selectLibraryAndBook, initializeSearch };
|
||||
|
||||
Alpine.data("search", () => ({
|
||||
selectLibraryAndBook,
|
||||
initializeSearch,
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user