PluginProbe
Social Media Auto Poster – Schedule & Publish to Buffer / trunk
Social Media Auto Poster – Schedule & Publish to Buffer vtrunk
6.2.3 6.2.2 6.2.1 6.2.0 6.1.2 6.1.1 6.1.0 6.0.9 6.0.8 6.0.7 6.0.6 6.0.5 6.0.4 6.0.3 6.0.2 6.0.1 6.0.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.8.6 3.8.7 3.8.8 All 124 releases
wp-to-buffer / lib / shared / js / inline-search.js

inline-search.js in Social Media Auto Poster – Schedule & Publish to Buffer trunk, at lib/shared/js/inline-search.js

49 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * Inline Search
3 *
4 * @package WPZincDashboardWidget
5 * @author WP Zinc
6 */
7
8 jQuery( document ).ready(
9 function ( $ ) {
10
11 // Search on keyup.
12 $( 'input[type="search"]' ).on(
13 'search keyup',
14 function ( e ) {
15
16 // Don't do anything if this search field doesn't have a data- attribute.
17 if ( typeof $( this ).data( 'list' ) == 'undefined' ) {
18 return;
19 }
20
21 // Filter the target search list.
22 var search_terms = $( this ).val().toLowerCase(),
23 search_list = $( this ).data( 'list' );
24
25 // If the search terms are blank, show everything.
26 if ( search_terms.length == 0 ) {
27 $( 'li', $( search_list ) ).show();
28 return;
29 }
30
31 // Show or hide each list item depending on the search term.
32 $( 'li', $( search_list ) ).each(
33 function () {
34 if ( $( this ).text().toLowerCase().search( search_terms ) > -1 ) {
35 // Search Term in this list item - display.
36 $( this ).show();
37 } else {
38 // Search Term not in this list item - hide.
39 $( this ).hide();
40 }
41 }
42 );
43
44 }
45 );
46
47 }
48 );
49