22// Search is handled by Alpine.js component in search-modal.html
33
44// Additional keyboard shortcuts and utilities
5- document . addEventListener ( ' DOMContentLoaded' , ( ) => {
6- console . log ( ' ✓ Hugo Blox Search initialized (Pagefind Headless API)' ) ;
7-
5+ document . addEventListener ( " DOMContentLoaded" , ( ) => {
6+ console . log ( " ✓ Hugo Blox Search initialized (Pagefind Headless API)" ) ;
7+
88 // Handle search toggle buttons
9- const searchButtons = document . querySelectorAll ( ' [data-search-toggle]' ) ;
10- searchButtons . forEach ( button => {
11- button . addEventListener ( ' click' , ( e ) => {
9+ const searchButtons = document . querySelectorAll ( " [data-search-toggle]" ) ;
10+ searchButtons . forEach ( ( button ) => {
11+ button . addEventListener ( " click" , ( e ) => {
1212 const prefilledQuery = button . dataset . searchQuery ;
13-
14- if ( window . Alpine && Alpine . store ( ' search' ) ) {
15- Alpine . store ( ' search' ) . open = true ;
16-
13+
14+ if ( window . Alpine && Alpine . store ( " search" ) ) {
15+ Alpine . store ( " search" ) . open = true ;
16+
1717 // Pre-fill query if specified
1818 if ( prefilledQuery ) {
1919 setTimeout ( ( ) => {
2020 const searchInput = document . querySelector ( '[x-ref="searchInput"]' ) ;
2121 if ( searchInput ) {
2222 searchInput . value = prefilledQuery ;
23- searchInput . dispatchEvent ( new Event ( ' input' ) ) ;
23+ searchInput . dispatchEvent ( new Event ( " input" ) ) ;
2424 }
2525 } , 100 ) ;
2626 }
2727 }
2828 } ) ;
2929 } ) ;
30-
30+
3131 // Note: Keyboard navigation (arrow keys, Enter) is handled by Alpine.js in search-modal.html
32- } ) ;
32+ } ) ;
0 commit comments