Conditions | 1 |
Paths | 1 |
Total Lines | 32 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | /** |
||
7 | jQuery( 'input[name=smbd_meta_term_taxonomy]' ).change(function(){ |
||
8 | jQuery( '.select2-terms' ).select2( { |
||
9 | ajax: { |
||
10 | url: ajaxurl, |
||
11 | dataType: 'json', |
||
12 | delay: 250, |
||
13 | data: function ( params ) { |
||
14 | return { |
||
15 | q: params.term, |
||
16 | taxonomy: jQuery('input[name=smbd_meta_term_taxonomy]:checked').val(), |
||
17 | action: 'bd_load_taxonomy_term' |
||
18 | }; |
||
19 | }, |
||
20 | processResults: function ( data ) { |
||
21 | var options = []; |
||
22 | |||
23 | if ( data ) { |
||
24 | jQuery.each( data, function ( index, dataPair ) { |
||
25 | options.push( { id: dataPair[ 0 ], text: dataPair[ 1 ] } ); |
||
26 | } ); |
||
27 | } |
||
28 | |||
29 | return { |
||
30 | results: options |
||
31 | }; |
||
32 | }, |
||
33 | cache: true |
||
34 | }, |
||
35 | minimumInputLength: 2, // the minimum of symbols to input before perform a search |
||
36 | width: '300px' |
||
37 | } ); |
||
38 | }); |
||
39 | |||
72 | } ); |