File tree 3 files changed +20
-6
lines changed
layouts/shortcodes/ecosystem/registry
3 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -163,12 +163,12 @@ function executeSearch(searchQuery) {
163
163
let results = miniSearch . search ( searchQuery ) ;
164
164
document . getElementById ( 'search-loading' ) . style . display = 'none' ;
165
165
166
- if ( results . length > 0 ) {
167
- populateResults ( results ) ;
168
- } else {
169
- document . querySelector ( '#search-results' ) . innerHTML +=
170
- '<p>No matches found</p>' ;
171
- }
166
+ if ( results . length === 0 ) {
167
+ document . getElementById ( 'no-search-result' ) . style . display = 'block' ;
168
+ }
169
+
170
+ populateResults ( results ) ;
171
+
172
172
} , 0 ) ;
173
173
} ;
174
174
Original file line number Diff line number Diff line change 141
141
< span class ="spinner-border spinner-border-sm " aria-hidden ="true "> </ span >
142
142
< span role ="status "> Loading results…</ span >
143
143
</ div >
144
+
145
+ <!-- When search hs no result -->
146
+ < div style ="display: none; padding:20px; text-align: center; " id ="no-search-result ">
147
+ < div style ="margin-left: auto; margin-right: auto; width: fit-content; ">
148
+ {{ with resources.Get "icons/search-not-found.png" }}
149
+ < img style ="border: none; " src ="{{ .RelPermalink }} " width ="250 " alt ="no result found ">
150
+ {{ end }}
151
+ </ div >
152
+ < p style ="color: #4f62ad; font-size: 28px; margin-bottom: 0; "> Oops no results found</ p >
153
+ < p > No results match the filter criteria. Remove filter or clear all filters to show results</ p >
154
+ < button type ="button " class ="btn btn-outline-danger "
155
+ onclick ="document.getElementById('input-s').value = ''; document.getElementById('input-language').value = 'all';document.getElementById('input-component').value = 'all';document.getElementById('searchForm').submit(); "> Reset filters</ button >
156
+ </ div >
157
+
144
158
< ul class ="list-unstyled " id ="search-results "> </ ul >
145
159
< ul class ="list-unstyled " id ="default-body ">
146
160
{{ range $key, $value := $registry -}}
You can’t perform that action at this time.
0 commit comments