1var bapf_select2_init, 2bapf_select2_init_for_parent, 3bapf_select2_disable_for_parent; 4jQuery(document).ready(function() { 5 bapf_select2_init = function() { 6 bapf_select2_init_for_parent(jQuery(document)); 7 } 8 bapf_select2_init_for_parent = function($parent) { 9 if( $parent.find('.bapf_select2').length && typeof($parent.find('.bapf_select2').select2) != 'undefined' ) { 10 $parent.find('.bapf_select2').each(function() { 11 if ( ! jQuery(this).data('select2') && ! jQuery(this).is('.select2-hidden-accessible') ) { 12 var select2data = {width:'100%', theme:'default'}; 13 if (jQuery(this).prop('multiple') ) { 14 select2data.placeholder = jQuery(this).data('placeholder'); 15 } 16 if( jQuery(this).parents('#berocket-ajax-filters-sidebar').length ) { 17 if( jQuery('#bapf-select2-high-zindex').length == 0 ) { 18 jQuery('body').append('<div id="bapf-select2-high-zindex"></div>'); 19 } 20 select2data.dropdownParent = jQuery('#bapf-select2-high-zindex'); 21 } 22 select2data = berocket_apply_filters('jqrui_data_select2', select2data, jQuery(this)); 23 jQuery(this).select2(select2data); 24 } 25 }); 26 } 27 } 28 bapf_select2_disable_for_parent = function($parent) { 29 if( $parent.find('.bapf_select2').length && typeof($parent.find('.bapf_select2').select2) != 'undefined' ) { 30 $parent.find('.bapf_select2').each(function() { 31 if ( jQuery(this).data('select2') ) { 32 jQuery(this).select2('destroy'); 33 } 34 }); 35 } 36 } 37 jQuery(document).on('berocket_ajax_filtering_on_update', function() { 38 if( jQuery('.bapf_sfilter .bapf_select2').length && typeof(jQuery('.bapf_sfilter .bapf_select2').select2) == 'function' ) { 39 jQuery('.bapf_sfilter .bapf_select2').each(function() { 40 if (jQuery(this).data('select2')) { 41 jQuery(this).select2('close'); 42 } 43 }); 44 } 45 bapf_select2_disable_for_parent(jQuery(document)); 46 }); 47 function bapf_select2_berocket_add_filter() { 48 bapf_select2_init(); 49 berocket_add_filter('braapf_init', bapf_select2_init, 2000); 50 berocket_add_filter('braapf_init_for_parent', bapf_select2_init_for_parent); 51 } 52 if ( typeof(berocket_add_filter) == 'function' ) { 53 bapf_select2_berocket_add_filter(); 54 } else { 55 jQuery(document).on('berocket_hooks_ready', function() { 56 bapf_select2_berocket_add_filter(); 57 }); 58 } 59});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.