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 @@ -137,12 +137,12 @@ function executeSearch(searchQuery) {
137
137
let results = miniSearch . search ( searchQuery ) ;
138
138
document . getElementById ( 'search-loading' ) . style . display = 'none' ;
139
139
140
- if ( results . length > 0 ) {
141
- populateResults ( results ) ;
142
- } else {
143
- document . querySelector ( '#search-results' ) . innerHTML +=
144
- '<p>No matches found</p>' ;
145
- }
140
+ if ( results . length === 0 ) {
141
+ document . getElementById ( 'no-search-result' ) . style . display = 'block' ;
142
+ }
143
+
144
+ populateResults ( results ) ;
145
+
146
146
} , 0 ) ;
147
147
} ;
148
148
Original file line number Diff line number Diff line change 97
97
< span class ="spinner-border spinner-border-sm " aria-hidden ="true "> </ span >
98
98
< span role ="status "> Loading results…</ span >
99
99
</ div >
100
+
101
+ <!-- When search hs no result -->
102
+ < div style ="display: none; padding:20px; text-align: center; " id ="no-search-result ">
103
+ < div style ="margin-left: auto; margin-right: auto; width: fit-content; ">
104
+ {{ with resources.Get "icons/search-not-found.png" }}
105
+ < img style ="border: none; " src ="{{ .RelPermalink }} " width ="250 " alt ="no result found ">
106
+ {{ end }}
107
+ </ div >
108
+ < p style ="color: #4f62ad; font-size: 28px; margin-bottom: 0; "> Oops no results found</ p >
109
+ < p > No results match the filter criteria. Remove filter or clear all filters to show results</ p >
110
+ < button type ="button " class ="btn btn-outline-danger "
111
+ 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 >
112
+ </ div >
113
+
100
114
< ul class ="list-unstyled " id ="search-results "> </ ul >
101
115
< ul class ="list-unstyled " id ="default-body ">
102
116
{{ range $key, $value := $registry -}}
You can’t perform that action at this time.
0 commit comments