File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -132,19 +132,14 @@ $(document).ready(function() {
132132 } ) ;
133133
134134 let link = $ ( '.ds-dropdown-menu a.search-page-link' ) ;
135- const href = '/en/' + branchName + '/search_results/?sq=' + encodeURI ( $ ( '#search_input' ) . val ( ) ) + '&p=1' ;
136-
137135 if ( ! link . length ) {
138- link = $ ( '.ds-dropdown-menu' ) . append ( `<div class="search-page-link-wrapper">
136+ $ ( '.ds-dropdown-menu' ) . append ( `<div class="search-page-link-wrapper">
139137 <a class="search-page-link" href="">See all results</a>
140138 </div>` ) ;
139+ link = $ ( '.ds-dropdown-menu a.search-page-link' ) ;
141140 }
142-
143- link . attr ( 'href' , href ) . show ( ) ;
144-
145- if ( hits . length < hitsPerPage ) {
146- link . hide ( ) ;
147- }
141+ const href = '/en/' + branchName + '/search_results/?sq=' + encodeURI ( $ ( '#search_input' ) . val ( ) ) + '&p=1' ;
142+ link . attr ( 'href' , href ) . toggle ( hits . length >= hitsPerPage ) ;
148143 } ,
149144 algoliaOptions : {
150145 facetFilters : [ 'lang:en' , 'version:' + branchName ] ,
You can’t perform that action at this time.
0 commit comments