1'use strict'; 2 3(function($) { 4 $(document).on('woovr_selected', function(e, selected) { 5 let id = selected.attr('data-id'); 6 let pid = selected.attr('data-pid'); 7 let purchasable = selected.attr('data-purchasable'); 8 9 if (purchasable === 'yes' && id >= 0) { 10 $('.wpcbn-btn[data-product_id="' + pid + '"]'). 11 removeClass('wpcbn-disabled'); 12 } else { 13 $('.wpcbn-btn[data-product_id="' + pid + '"]').addClass('wpcbn-disabled'); 14 } 15 16 $(document).trigger('wpcbn_woovr_selected', [selected]); 17 }); 18 19 $(document).on('found_variation', function(e, t) { 20 let pid = $(e['target']). 21 closest('.variations_form'). 22 attr('data-product_id'); 23 24 if (t['is_in_stock'] && t['is_purchasable']) { 25 $('.wpcbn-btn[data-product_id="' + pid + '"]'). 26 removeClass('wpcbn-disabled'); 27 } else { 28 $('.wpcbn-btn[data-product_id="' + pid + '"]').addClass('wpcbn-disabled'); 29 } 30 31 $(document).trigger('wpcbn_found_variation', [t]); 32 }); 33 34 $(document).on('reset_data', function(e) { 35 let pid = $(e['target']). 36 closest('.variations_form'). 37 attr('data-product_id'); 38 39 // disable button 40 $('.wpcbn-btn[data-product_id="' + pid + '"]').addClass('wpcbn-disabled'); 41 42 $(document).trigger('wpcbn_reset_data'); 43 }); 44})(jQuery);
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.