File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -33,15 +33,22 @@ <h1 class="color-gray-800 weight-700">{% t titles.documentation %}</h1>
33
33
</ div >
34
34
35
35
< script >
36
- $ ( document ) . ready ( function ( ) {
37
- var sjs = SimpleJekyllSearch ( {
36
+ const initSearch = ( ) => {
37
+ SimpleJekyllSearch ( {
38
38
searchInput : document . getElementById ( 'search-input' ) ,
39
39
resultsContainer : document . getElementById ( 'results-container' ) ,
40
40
noResultsText : "{% t documentation.general.no-results %} :(" ,
41
41
searchResultTemplate : '<li><a href="{url}">{title}</a></li>' ,
42
42
limit : 5 ,
43
43
fuzzy : false ,
44
44
json : '{% if site.lang != "en" %}/{{ site.lang }}{% endif %}/assets/datasets/documentation_index.json'
45
- } )
46
- } ) ;
45
+ } ) ;
46
+ } ;
47
+ if ( 'loading' === document . readyState ) {
48
+ // Loading hasn't finished yet.
49
+ document . addEventListener ( 'DOMContentLoaded' , initSearch )
50
+ } else {
51
+ // `DOMContentLoaded` has already fired.
52
+ initSearch ( )
53
+ }
47
54
</ script >
You can’t perform that action at this time.
0 commit comments