1/** 2 * Created by pozdny on 31.05.2017. 3 */ 4 5$(function(){ 6 7 if (document.body.clientWidth > 768) { 8 $('.js-news-grid').masonry({ 9 columnWidth: ".main-news-grid-item", 10 itemSelector: ".main-news-grid-item", 11 percentPosition: true 12 }).imagesLoaded() 13 .always(function (instance) { 14 $('.js-news-grid').masonry(); 15 }); 16 } 17 18 $('.moreNews').on('click', function(){ 19 var $this = $(this); 20 var url = '/?' + $this.attr('href').split('?')[1]; 21 var data = { 22 ajax_type : 'news' 23 }; 24 if($this.data('filter') !== undefined && $this.data('filter') > 0){ 25 data.filter = $this.data('filter'); 26 } 27 $.post(url, data, function(html){ 28 var $html = $('<div>'+html+'</div>'); 29 var elements = $html.find('.main-news-grid-item'); 30 var $moreLink = $html.find('.moreNews'); 31 var newsBlock = $('.newsBlock'); 32 $this.prev('.js-news-grid') 33 .append(elements) 34 .masonry( 'appended', elements ) 35 .masonry() 36 .imagesLoaded() 37 .always( function( instance ) { 38 $this.prev('.js-news-grid').masonry(); 39 }); 40 41 42 if (!$moreLink.length) { 43 // conflict with bootstrap xs-visible 44 $('#bigMoreLoad').attr("style", "display: none !important"); 45 $('.loadMoreButton').attr("style", "display: none !important"); 46 } 47 else { 48 $this.attr('href', $moreLink.attr('href')); 49 } 50 }); 51 return false; 52 }); 53 54 $('#bigMoreLoad').on('click', function(){ 55 var $this = $(this); 56 $('.moreNews').trigger('click'); 57 return false; 58 }); 59 60 $(window).resize(function() { 61 $('.js-news-grid').masonry({ 62 columnWidth: ".main-news-grid-item", 63 itemSelector: ".main-news-grid-item" 64 }); 65 }); 66 let linkItem = $('.main-news-grid-item .news-card'); 67 let linkIssue = $('.main-news-grid-item .news-card a.link-issue'); 68 linkItem.on('click', function(e){ 69 let href = $(this).data('href'); 70 let newOpen = $(this).data('new'); 71 if(href.length && newOpen){ 72 window.open( 73 href, 74 '_blank' 75 ); 76 }else{ 77 window.open( 78 href, 79 '_self' 80 ); 81 } 82 }); 83 linkIssue.on('click', function(e){ 84 e.stopPropagation(); 85 }); 86 87 let mainNews = $('.news-card.main'); 88 if(mainNews.length){ 89 let outLink = mainNews.find('.nm').data('link'); 90 if(outLink){ 91 mainNews.on('click', function(e){ 92 e.stopPropagation(); 93 window.open( 94 outLink, 95 '_blank' 96 ); 97 }); 98 } 99 } 100});
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.