1bxajaxidLink = function(element) { 2 if (!element || !element.href) return false; 3 var $this = $(element); 4 var bxparent = $this.parents("div[id^=comp_]"); 5 if (bxparent.length) 6 { 7 Popup({ 8 content: element.href, 9 ajaxData: { "bxajaxid": bxparent[0].id.replace("comp_","") }, 10 }); 11 return false; 12 } 13} 14 15function FixerBlockDelivery(){ 16 var $d = $(".news-delivery .news-delivery-item"), 17 $l = $(".news-items-block"), 18 dop_height = 90, 19 dHeight = $d.height(), 20 lHeight = $(".bx_pagination_bottom").offset().top, 21 lTop = $l.offset().top, 22 scrollTop = $(window).scrollTop() + dop_height; 23 24 if ($d.css("display")!="none"){ 25 $d.addClass("news-item-fixed"); 26 if (scrollTop > lTop){ 27 console.log(scrollTop + dHeight,lTop); 28 if ((scrollTop + dHeight)< (lHeight - 60)){ 29 $d.css("position","fixed").addClass("news-item-fixed").css("top",dop_height); 30 } 31 else{ 32 $d.css("position","absolute").css("top",(lHeight - dHeight - lTop - 60)); 33 } 34 } 35 else{ 36 $d.css("position","inherit"); 37 $d.removeClass("news-item-fixed").css("top",0); 38 } 39 } 40}; 41 42$(window).scroll(function() { 43 FixerBlockDelivery(); 44 changeBlocksPosition(); 45}); 46$(window).resize(function(){ 47 FixerBlockDelivery(); 48 changeBlocksPosition(); 49}); 50$(document).ready(function(){ 51 FixerBlockDelivery(); 52 $(".bx_pagination_getmore").add(".bx_page").click(function(){ 53 console.log(123); 54 FixerBlockDelivery(); 55 }); 56 57 changeBlocksPosition(); 58}); 59 60let countItemInRow = 0; 61let itemSelector = '.news-item'; 62 63changeBlocksPosition = function () { 64 let newCountItemInRow = getCountItemInRow(); 65 let hasBanner = false; 66 67 if (countItemInRow == newCountItemInRow) { 68 return; 69 } 70 countItemInRow = newCountItemInRow; 71 72 let bannerBlock = $('.news-blog__change-position[has-b="Y"]'); 73 if (bannerBlock.length > 0 && bannerBlock.has('div').length > 0) { 74 hasBanner = true; 75 } 76 77 $('.news-blog__change-position').each(function () { 78 if (!hasBanner && $(this).attr('has-b') == 'Y') return; 79 80 let rowNum = -2; 81 let attrAfterRow = $(this).attr('after-row'); 82 let attrAfterRowWithB = $(this).attr('after-row-width-b'); 83 84 let correctPositionSpan = $(this).find('.news-blog__change-position__correct-position'); 85 if (correctPositionSpan.length > 0) { 86 let correctPositionSpanAttr = correctPositionSpan.attr('row'); 87 if (correctPositionSpanAttr && !isNaN(parseInt(correctPositionSpanAttr))) { 88 attrAfterRow = correctPositionSpanAttr; 89 $(this).attr('after-row', correctPositionSpanAttr); 90 } 91 correctPositionSpan.remove(); 92 } 93 94 if (attrAfterRow && !isNaN(parseInt(attrAfterRow))) { 95 rowNum = attrAfterRow; 96 } 97 if (hasBanner && attrAfterRowWithB && !isNaN(parseInt(attrAfterRowWithB))) { 98 rowNum = attrAfterRowWithB; 99 } 100 if (rowNum == -2) return; 101 102 switch (rowNum) { 103 case '-1': 104 if ($('.section-list').length > 0) { 105 $('.section-list').before($(this)); 106 $(this).find('.pr15.pl15').removeClass('pr15 pl15'); 107 } else { 108 $('.news-items-block .row').prepend($(this)); 109 } 110 break; 111 case '0': 112 $('.news-items-block .row').prepend($(this)); 113 break; 114 default: 115 let itemNum = countItemInRow * rowNum - 1; 116 let item = $(itemSelector + ':eq(' + itemNum + ')'); 117 if (item.length > 0) { 118 item.addClass('news-blog__change-position__selected-item'); 119 $('.news-items-block .row').find('div').has('.news-blog__change-position__selected-item').after($(this)); 120 item.removeClass('news-blog__change-position__selected-item'); 121 } 122 } 123 }); 124} 125 126getCountItemInRow = function () { 127 let num = 0; 128 let lastPosition = 0; 129 $(itemSelector).each(function () { 130 let position = $(this).offset().top; 131 if (lastPosition == 0) { 132 lastPosition = position; 133 } 134 if (position > lastPosition) { 135 return; 136 } 137 num++; 138 }); 139 140 return num; 141}
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.