1$(document).ready(function() { 2 3 $('body').on('click', '.ax-swatches-more', function (e) { 4 $(this).closest('.js-product-miniature').addClass('ax-show-swatches'); 5 }); 6 7 $('body').on('click', '.js-variant', function (event) { 8 event.preventDefault(); 9 var self = this; 10 if($(self).hasClass('active')){ 11 return; 12 } 13 prestashop.emit('clickAjaxVariant', { 14 dataset: self.dataset, 15 self: self 16 }); 17 }); 18 19 prestashop.on('clickAjaxVariant', function (elm) { 20 $(elm.self).append('<span class="variants-loader-icon"><i class="la la-circle-notch la-spin"></i></span>'); 21 var data = { 22 'tplProduct': elm.dataset.tplProduct, 23 'imageType': elm.dataset.imageType, 24 'idProduct': elm.dataset.idProduct, 25 'idProductAttribute': elm.dataset.idProductAttribute 26 }; 27 28 $.post(elm.dataset.url, data, null, 'json').then(function (resp) { 29 if (resp.success) { 30 var $class = ''; 31 32 if($(elm.self).closest('.js-product-miniature').hasClass('ax-show-swatches')){ 33 $class = 'ax-show-swatches'; 34 } 35 36 var $elr = $(resp.data.message).find('.js-product-miniature'); 37 $elr.addClass($class); 38 39 $(elm.self).closest('.js-product-miniature').replaceWith($elr); 40 41 prestashop.emit('updatedProductAjax', null); 42 } 43 }).fail(function (resp) { 44 prestashop.emit('handleError', { eventType: 'clickAjaxVariant', resp: resp }); 45 }); 46 }); 47 48});
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.