File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
tutorials/themes/tutorials-theme/static Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -337,9 +337,12 @@ var Search = {
337337 var params = $ . getQueryParameters ( ) ;
338338 if ( params . q ) {
339339 var query = params . q [ 0 ] ;
340- $ ( 'input[name="q"]' ) [ 0 ] . value = query ;
341- this . performSearch ( query ) ;
340+ } else {
341+ // If no query string is passed, assume we want to filterTutorials
342+ var query = "filterTutorials" ;
342343 }
344+ $ ( 'input[name="q"]' ) [ 0 ] . value = query ;
345+ this . performSearch ( query ) ;
343346 } ,
344347
345348 loadIndex : function ( url ) {
@@ -410,7 +413,7 @@ var Search = {
410413 this . deferQuery ( query ) ;
411414
412415 //Perform search in Astropy Documentation
413- if ( window . location . search . search ( "filterTutorials" ) == - 1 ) { //if filtered by tutorials, then no need to search in Astropy Documentation
416+ if ( query . includes ( "filterTutorials" ) ) { // don't search docs if we are just looking for tutorials
414417 var docResponse = null ;
415418 var docResult = '' ;
416419 $ . get ( 'https://readthedocs.org/api/v2/docsearch/?q=' + window . location . search . split ( '=' ) [ 1 ] + '&project=astropy&version=stable&language=en' , function ( response ) {
You can’t perform that action at this time.
0 commit comments