1$(window).on('load', function() { 2 const isMain = $('body').hasClass('is-main'); 3 4 if (isMain) { 5 var mainSliderBlock = $('#main-block'); 6 7 $('.recommendations-block').on('touchstart', '.block-action__wrapper', function () { 8 $(this).parent().addClass('swiped'); 9 if (isBlockVisible(mainSliderBlock)) { 10 $('html, body').animate({scrollTop: 0}, 500, 'swing'); 11 } 12 13 var currentSliderTab = $('#main-block .tabs-buttons .active'), 14 sliderTabNext = currentSliderTab.next(); 15 16 if (sliderTabNext.length === 0) { 17 sliderTabNext = $('#main-block .tabs-buttons').children().first(); 18 } 19 20 sliderTabNext.click(); 21 }); 22 23 $('.recommendations-block').on('touchend', '.block-action__wrapper', function () { 24 $(this).parent().removeClass('swiped'); 25 }); 26 } else { 27 var itemsPostsWrapper = $('body').find('.recommend-items__block'), 28 itemsPostsSlider = itemsPostsWrapper.find('.owl-carousel'), 29 totalItems = itemsPostsWrapper.find('.item').length; 30 31 if (itemsPostsWrapper.length) { 32 itemsPostsSlider.owlCarousel({ 33 items: 1, 34 dots: true, 35 loop: totalItems > 1, 36 stagePadding: totalItems > 1 ? 10 : 0, 37 }); 38 39 $('.recommendations-block .block-action__wrapper').swipe({ 40 swipeStatus: function (event, phase, direction, distance, duration, fingerCount, fingerData, currentDirection) { 41 var parent = $(this).parent(), sliderItemsBlock = parent.find('.recommend-items__block'); 42 43 if (direction === 'left') { 44 if (sliderItemsBlock.attr('style')) { 45 sliderItemsBlock.removeAttr('style'); 46 parent.addClass('swiped'); 47 itemsPostsWrapper.removeClass('hidden'); 48 } else { 49 itemsPostsSlider.trigger('next.owl.carousel'); 50 } 51 } else if (direction === 'right') { 52 parent.removeClass('swiped'); 53 sliderItemsBlock.hide(); 54 } 55 56 itemsPostsSlider.owlCarousel('refresh'); 57 }, 58 triggerOnTouchEnd: false, 59 threshold: 40 60 }); 61 62 setTimeout(function () { 63 $('body').find('.recommendations-block').removeAttr('style'); 64 itemsPostsSlider.owlCarousel('refresh'); 65 }, 5000); 66 } 67 } 68 69 $('.recommendations-block').on('click', '.close', function (e) { 70 e.preventDefault(); 71 e.stopPropagation(); 72 var blockParent = $(this).closest('.recommendations-block'); 73 blockParent.hide(); 74 }); 75});
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.