1var quantityInLoad = 3; 2 3$(document).ready(function () { 4 if (isMobile.any() && !isMobile.iPad()) { 5 $.each($(".load-more-section"), function (index, item) { 6 var loadMoreContent = item.getElementsByClassName("load-more-content"); 7 }); 8 9 $(".load-more-button").each(function () { 10 showItemInMobile($(this), 3); 11 }) 12 13 $(".load-more-button").click(async function () { 14 await showItemInMobile($(this), 3); 15 }); 16 } 17 else { 18 $(".load-more-button-6").each(async function () { 19 await showItemInMobile($(this), 6); 20 }) 21 22 $(".load-more-button-6").click(function () { 23 showItemInMobile($(this), 6); 24 }); 25 } 26 27}); 28 29function showItemInMobile(btnLoadMore, noOfShow) { 30 var listHiddenItems = []; 31 if (btnLoadMore.siblings(".load-more-content").hasClass("slider")) { 32 listHiddenItems = btnLoadMore.siblings(".load-more-content").children(".slide, .load-more-item").filter(function () { 33 var element = $(this); 34 if (element.css("display") === "none") { 35 return true; 36 } 37 else { 38 return false; 39 } 40 }); 41 } 42 else if (btnLoadMore.siblings(".row").hasClass("vertical-products")) { 43 listHiddenItems = btnLoadMore.siblings(".row").children(".lazy, .load-more-item").filter(function () { 44 var element = $(this); 45 if (element.css("display") === "none") { 46 return true; 47 } 48 else { 49 return false; 50 } 51 }); 52 53 //console.log('listHiddenItems', listHiddenItems); 54 } 55 else { 56 listHiddenItems = btnLoadMore.siblings(".load-more-content").children(".row").children(".load-more-item").filter(function () { 57 var element = $(this); 58 if (element.css("display") === "none") { 59 return true; 60 } 61 else { 62 return false; 63 } 64 }); 65 } 66 67 if (listHiddenItems.length > noOfShow) { 68 btnLoadMore.show(); 69 } 70 else { 71 btnLoadMore.hide(); 72 } 73 74 var isEnd = listHiddenItems.length <= noOfShow; 75 if (isEnd) { 76 btnLoadMore.remove(); 77 } 78 loadMoreItem(noOfShow, listHiddenItems); 79} 80 81 82function loadMoreItem(quantityInLoad, arrayItem) { 83 var isExitAsyncImage = false; 84 for (var i = 0; i < quantityInLoad; i++) { 85 if (arrayItem[i] !== undefined) { 86 if ($(arrayItem[i]).find('img').length > 0) { 87 var img = $(arrayItem[i]).find('img')[0]; 88 if ($(img).hasClass("asyncImageWait")) { 89 $(img).removeClass('asyncImageWait'); 90 $(img).addClass('asyncImage'); 91 isExitAsyncImage = true; 92 } 93 } 94 $(arrayItem[i]).fadeIn(500); 95 } 96 } 97 98 if (isExitAsyncImage) { 99 loadImageOriginal(false); 100 } 101}
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.