11const searchButtonContainerIds = [
2- "fern-search-bar" ,
32 "fern-search-button" ,
3+ "fern-search-bar"
44] ;
55
66// Define the base settings
77const inkeepSettings = {
8- isOpen : true ,
98 baseSettings : {
109 apiKey : "a58574ddc0e41c75990d1c0e890ad3c8725dc9e7c8ee3d3e" ,
1110 integrationId : "clthv1rgg000sdjil26l2vg03" ,
@@ -34,26 +33,6 @@ const inkeepSettings = {
3433 }
3534} ;
3635
37- // Function to initialize search containers
38- function initializeSearchContainers ( ) {
39- // Clone and replace search buttons to remove existing listeners
40- // Only process elements that exist
41- const clonedSearchButtonContainers = searchButtonContainerIds
42- . map ( ( id ) => {
43- const originalElement = document . getElementById ( id ) ;
44- if ( ! originalElement ) {
45- console . log ( `Search container ${ id } not found, skipping...` ) ;
46- return null ;
47- }
48- const clonedElement = originalElement . cloneNode ( true ) ;
49- originalElement . parentNode . replaceChild ( clonedElement , originalElement ) ;
50- return clonedElement ;
51- } )
52- . filter ( Boolean ) ; // Remove null entries
53-
54- return clonedSearchButtonContainers ;
55- }
56-
5736// Function to initialize Inkeep
5837function initializeInkeep ( ) {
5938 // Color mode sync settings
@@ -88,13 +67,23 @@ function initializeInkeep() {
8867 } ,
8968 } ,
9069 } ) ;
91-
92- // Get search containers after DOM is ready
93- const clonedSearchButtonContainers = initializeSearchContainers ( ) ;
70+
71+ const clonedSearchButtonContainers = searchButtonContainerIds
72+ . map ( ( id ) => {
73+ const originalElement = document . getElementById ( id ) ;
74+ if ( ! originalElement ) {
75+ console . log ( `Search container ${ id } not found, skipping...` ) ;
76+ return null ;
77+ }
78+ originalElement . disabled = false ;
79+ return originalElement
80+ } ) . filter ( Boolean ) ;
9481
9582 // Add click listeners to search buttons
9683 clonedSearchButtonContainers . forEach ( ( trigger ) => {
84+ console . log ( "adding trigger" )
9785 trigger . addEventListener ( "click" , function ( ) {
86+ console . log ( "clicked" )
9887 inkeepSearchModal . render ( {
9988 isOpen : true ,
10089 } ) ;
@@ -106,7 +95,6 @@ function initializeInkeep() {
10695 "keydown" ,
10796 ( event ) => {
10897 if (
109- ( event . metaKey || event . ctrlKey ) &&
11098 ( event . key === "/" )
11199 ) {
112100 event . stopPropagation ( ) ;
0 commit comments