@@ -2424,10 +2424,7 @@ function initSearch(rawSearchIndex) {
2424
2424
* @param {boolean } display - True if this is the active tab
2425
2425
*/
2426
2426
function addTab ( array , query , display ) {
2427
- let extraClass = "" ;
2428
- if ( display === true ) {
2429
- extraClass = " active" ;
2430
- }
2427
+ const extraClass = display ? " active" : "" ;
2431
2428
2432
2429
const output = document . createElement ( "div" ) ;
2433
2430
let length = 0 ;
@@ -2669,13 +2666,9 @@ ${item.displayPath}<span class="${type}">${name}</span>\
2669
2666
/**
2670
2667
* Perform a search based on the current state of the search input element
2671
2668
* and display the results.
2672
- * @param {Event } [e] - The event that triggered this search, if any
2673
2669
* @param {boolean } [forced]
2674
2670
*/
2675
- function search ( e , forced ) {
2676
- if ( e ) {
2677
- e . preventDefault ( ) ;
2678
- }
2671
+ function search ( forced ) {
2679
2672
const query = parseQuery ( searchState . input . value . trim ( ) ) ;
2680
2673
let filterCrates = getFilterCrates ( ) ;
2681
2674
@@ -3212,7 +3205,8 @@ ${item.displayPath}<span class="${type}">${name}</span>\
3212
3205
// popping a state (Firefox), which is why search() is
3213
3206
// called both here and at the end of the startSearch()
3214
3207
// function.
3215
- search ( e ) ;
3208
+ e . preventDefault ( ) ;
3209
+ search ( ) ;
3216
3210
} else {
3217
3211
searchState . input . value = "" ;
3218
3212
// When browsing back from search results the main page
@@ -3247,7 +3241,7 @@ ${item.displayPath}<span class="${type}">${name}</span>\
3247
3241
// before paste back the previous search, you get the old search results without
3248
3242
// the filter. To prevent this, we need to remove the previous results.
3249
3243
currentResults = null ;
3250
- search ( undefined , true ) ;
3244
+ search ( true ) ;
3251
3245
}
3252
3246
3253
3247
/**
0 commit comments