File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed
sphinx/themes/basic/static Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -155,8 +155,9 @@ These themes are:
155155 want a width limit. Defaults may depend on the theme (often 800px).
156156
157157 - **navigation_with_keys ** (true or false): Allow navigating to the
158- previous/next page using the keyboard's left and right arrows. Defaults to
159- ``False ``.
158+ previous/next page using the keyboard's left and right arrows.
159+ Apart from that, 's' and '/' jumps to Quick search and 'c'
160+ hides search matches. Defaults to ``False ``.
160161
161162 - **globaltoc_collapse ** (true or false): Only expand subsections
162163 of the current document in ``globaltoc.html ``
Original file line number Diff line number Diff line change @@ -294,21 +294,28 @@ var Documentation = {
294294 if ( activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT'
295295 && activeElementType !== 'BUTTON' && ! event . altKey && ! event . ctrlKey && ! event . metaKey
296296 && ! event . shiftKey ) {
297- switch ( event . keyCode ) {
298- case 37 : // left
297+ switch ( event . key ) {
298+ case 'ArrowLeft' :
299299 var prevHref = $ ( 'link[rel="prev"]' ) . prop ( 'href' ) ;
300300 if ( prevHref ) {
301301 window . location . href = prevHref ;
302302 return false ;
303303 }
304- break ;
305- case 39 : // right
304+ case 'ArrowRight' :
306305 var nextHref = $ ( 'link[rel="next"]' ) . prop ( 'href' ) ;
307306 if ( nextHref ) {
308307 window . location . href = nextHref ;
309308 return false ;
310309 }
311- break ;
310+ case '/' :
311+ case 's' :
312+ $ ( 'input[name=q]' ) . focus ( ) ;
313+ return false ;
314+ case 'h' :
315+ newurl = window . location . href . replace ( new RegExp ( '\\?highlight=[^#]*' ) , '' ) ;
316+ history . pushState ( { } , null , newurl ) ;
317+ Documentation . hideSearchWords ( ) ;
318+ return false ;
312319 }
313320 }
314321 } ) ;
You can’t perform that action at this time.
0 commit comments