File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 33 var sections = document . querySelectorAll ( '.searchable_section' ) ;
44 var searchInput = document . getElementById ( 'function_filter' ) ;
55
6+ function searchValue ( ) {
7+ return searchInput . value . trim ( ) . replace ( / ^ _ \. / , '' ) ;
8+ }
9+
610 function strIn ( a , b ) {
711 a = a . toLowerCase ( ) ;
812 b = b . toLowerCase ( ) ;
1216 function doesMatch ( element ) {
1317 var name = element . getAttribute ( 'data-name' ) ;
1418 var aliases = element . getAttribute ( 'data-aliases' ) || '' ;
15- return strIn ( searchInput . value , name ) || strIn ( searchInput . value , aliases ) ;
19+ var value = searchValue ( ) ;
20+ return strIn ( value , name ) || strIn ( value , aliases ) ;
1621 }
1722
1823 function filterElement ( element ) {
2227 function filterToc ( ) {
2328 _ . each ( functions , filterElement ) ;
2429
25- var emptySearch = searchInput . value === '' ;
30+ var emptySearch = searchValue ( ) === '' ;
2631
2732 // Hide the titles of empty sections
2833 _ . each ( sections , function ( section ) {
3439
3540 function gotoFirst ( ) {
3641 var firstFunction = _ . find ( functions , doesMatch ) ;
37- if ( firstFunction ) {
42+ if ( firstFunction ) {
3843 window . location . hash = firstFunction . getAttribute ( 'data-name' ) ;
3944 searchInput . focus ( ) ;
4045 }
You can’t perform that action at this time.
0 commit comments