1/** 2* @author Amazzing 3* @copyright Amazzing 4* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) 5*/ 6 7$.extend(customThemeActions, { 8 documentReady: function() { 9 af.productItemSelector = '.js-product-miniature-wrapper'; 10 customThemeActions.updateListViewParam($('.view-switcher').find('.current').data('view')); 11 customThemeActions.bindAdditionalEvents(); 12 }, 13 bindAdditionalEvents: function() { 14 $('#products').on('click', '.js-search-link', function(e) { 15 if ($(this).hasClass('select-list')) { 16 var txt = $(this).text(), 17 $title = $(this).closest('.dropdown').find('.select-title'); 18 if ($(this).closest('.products-nb-per-page').length) { // number of products per page 19 let nb_items = parseInt($(this).attr('href').split('resultsPerPage=')[1]); 20 $('#af_nb_items').val(nb_items).change(); 21 $title.contents().eq(0).replaceWith(txt); 22 } else if ($(this).closest('.products-sort-order').length) { // sorting 23 let value = $(this).attr('href').split('order=')[1].split('&')[0].split('.'); 24 af.applySorting(value[1], value[2]); 25 $title.find('.select-title-name').html(txt); 26 } 27 $title.parent().click(); 28 } else if ($(this).closest('.view-switcher').length) { // grid/list 29 customThemeActions.updateListViewParam($(this).data('view')); 30 $('#af_orderWay').change(); 31 } else { 32 return; 33 } 34 e.preventDefault(); 35 e.stopImmediatePropagation(); 36 }); 37 if ($('#search_center_filter_toggler').length) { 38 customThemeActions.centerPanelActions(); 39 } 40 }, 41 updateListViewParam: function(view) { 42 if (!af.$listViewInput) { 43 af.$listViewInput = $('<input type="hidden" name="listView">').appendTo('.hidden_inputs'); 44 } 45 af.$listViewInput.val(view || 'grid'); 46 }, 47 updateContentAfter: function (jsonData) { 48 prestashop.emit('afterUpdateProductList'); 49 if (load_more && jsonData.product_count_text) { 50 $('#js-product-list-top').find('.showing').html(af.utf8_decode(jsonData.product_count_text)); 51 } 52 }, 53 centerPanelActions: function() { 54 af.center_panel_open = $('#facets_search_center').is(':visible'); 55 $('.compact-toggle').addClass('hidden'); 56 $('.af_subtitle').on('click', function(e) { 57 if (!af.isCompact) { 58 e.stopImmediatePropagation(); 59 } 60 }); 61 if ($('#af_reload_action').val() == 2) { 62 af.$viewBtn.data('active-center', 1).on('click', function() { 63 if (!af.isCompact) { 64 $(this).data('clicked-center', 1); 65 } 66 }); 67 prestashop.on('afterUpdateProductList', function() { 68 setTimeout(function() { 69 if (!af.isCompact && af.center_panel_open && af.$viewBtn.data('clicked-center')) { 70 $('#search_center_filter_toggler').click(); 71 af.$viewBtn.data('clicked-center', 0); 72 } 73 }, 200); 74 }); 75 } 76 $('#products').on('click', '#search_center_filter_toggler', function(e) { 77 if (af.isCompact) { 78 e.stopImmediatePropagation(); 79 $('.compact-toggle').click(); 80 } else if (af.$viewBtn.data('active-center')) { 81 af.$viewBtn.data('active', af.center_panel_open); 82 } 83 }); 84 }, 85}); 86/* since 3.1.7 */
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.