This repository was archived by the owner on May 3, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +64
-2
lines changed Expand file tree Collapse file tree 2 files changed +64
-2
lines changed Original file line number Diff line number Diff line change 44
44
padding : 2rem 1rem ;
45
45
}
46
46
47
+ .search {
48
+ margin : 0 0 1rem 0 ;
49
+ width : 90% ;
50
+ }
51
+
47
52
.menu {
48
53
padding : 0 ;
49
54
}
177
182
178
183
<div class =" col-md-3 hidden-sm hidden-xs" >
179
184
185
+ <input type =" text" class =" form-control search" id =" search-methods" placeholder =" Search..." autocomplete =" off" >
186
+
180
187
<ul class =" menu" >
181
188
182
189
{{ #each files }}
187
194
188
195
{{ #each methods }}
189
196
190
- <li class =" scope-{{ #if isPrivate }} private{{ else }} public{{ /if }} " >
197
+ <li class =" method-link scope-{{ #if isPrivate }} private{{ else }} public{{ /if }} " >
191
198
<a href =" #{{ uid }} " title =" {{ name }} " >{{ name }} </a >
192
199
</li >
193
200
410
417
hljs .highlightBlock (this );
411
418
});
412
419
420
+ var $methodLinks = $ (' .method-link' );
421
+
422
+ $ (' #search-methods' ).on (' keyup' , function (e ) {
423
+
424
+ var query = new RegExp (e .target .value .replace (' ' , ' |' ), ' ig' );
425
+
426
+ $methodLinks .each (function () {
427
+
428
+ var $this = $ (this );
429
+
430
+ if (! $this .text ().match (query)) {
431
+
432
+ $this .hide ();
433
+
434
+ } else {
435
+
436
+ $this .show ();
437
+
438
+ }
439
+
440
+ });
441
+
442
+ });
443
+
413
444
$ (window ).on (' scroll' , handleScrollEvent);
414
445
415
446
handleScrollEvent ();
Original file line number Diff line number Diff line change 42
42
padding : 2rem 1rem ;
43
43
}
44
44
45
+ .search {
46
+ margin : 0 0 1rem 0 ;
47
+ width : 90% ;
48
+ }
49
+
45
50
.menu {
46
51
padding : 0 ;
47
52
}
171
176
172
177
< div class ="col-md-3 hidden-sm hidden-xs ">
173
178
179
+ < input type ="text " class ="form-control search " id ="search-methods " placeholder ="Search... " autocomplete ="off ">
180
+
174
181
< ul class ="menu ">
175
182
176
183
179
186
< ul >
180
187
181
188
182
- < li class ="scope-public ">
189
+ < li class ="method-link scope-public ">
183
190
< a href ="#index.js-plugin " title ="plugin "> plugin</ a >
184
191
</ li >
185
192
@@ -330,6 +337,30 @@ <h3>Returns</h3>
330
337
hljs . highlightBlock ( this ) ;
331
338
} ) ;
332
339
340
+ var $methodLinks = $ ( '.method-link' ) ;
341
+
342
+ $ ( '#search-methods' ) . on ( 'keyup' , function ( e ) {
343
+
344
+ var query = new RegExp ( e . target . value . replace ( ' ' , '|' ) , 'ig' ) ;
345
+
346
+ $methodLinks . each ( function ( ) {
347
+
348
+ var $this = $ ( this ) ;
349
+
350
+ if ( ! $this . text ( ) . match ( query ) ) {
351
+
352
+ $this . hide ( ) ;
353
+
354
+ } else {
355
+
356
+ $this . show ( ) ;
357
+
358
+ }
359
+
360
+ } ) ;
361
+
362
+ } ) ;
363
+
333
364
$ ( window ) . on ( 'scroll' , handleScrollEvent ) ;
334
365
335
366
handleScrollEvent ( ) ;
You can’t perform that action at this time.
0 commit comments