1jQuery( document ).ready( function($) { 2 if ( $('body').find('.dipl_masonry_gallery').length > 0 ) { 3 $( '.dipl_masonry_gallery' ).each( function() { 4 // let $this = $(this).find('.dipl_masonry_gallery_wrapper'); 5 dipl_init_masonry_gallery( $( this ).find( '.dipl_masonry_gallery_wrapper' ) ); 6 } ); 7 } 8} ); 9 10// Init the masonry gallery. 11function dipl_init_masonry_gallery( $wrapObj ) { 12 let $gallery = $wrapObj.isotope( { 13 // options 14 itemSelector: '.dipl_masonry_gallery_item', 15 layoutMode: 'masonry', 16 percentPosition: true, 17 resize: true, 18 masonry: { 19 columnWidth: '.dipl_masonry_gallery_item', 20 gutter: '.dipl_masonry_gallery_item_gutter' 21 } 22 } ); 23 $gallery.imagesLoaded( function() { 24 $gallery.isotope('layout'); 25 $gallery.isotope('reloadItems'); 26 } ); 27 if ( $wrapObj.find('.dipl_masonry_gallery_item').is('a') ) { 28 let $orderClass = $wrapObj.closest('.dipl_masonry_gallery').prop('class').match(/(dipl_masonry_gallery\_[^\s]*)/)[0] + '_lightbox'; 29 $wrapObj.magnificPopup({ 30 delegate: 'a', 31 type: 'image', 32 closeOnContentClick: false, 33 closeBtnInside: false, 34 mainClass: 'mfp-with-zoom mfp-img-mobile dipl_masonry_gallery_lightbox ' + $orderClass, 35 gallery: { 36 enabled: true, 37 tPrev: '', 38 tNext: '', 39 tCounter: '' 40 }, 41 image: { 42 markup: '<div class="mfp-figure">'+ 43 '<div class="mfp-close"></div>'+ 44 '<div class="mfp-img"></div>'+ 45 '<div class="mfp-bottom-bar">'+ 46 '<div class="mfp-title"></div>'+ 47 '</div>'+ 48 '</div>', 49 titleSrc: function(item) { 50 return item.el.find('.dipl_masonry_gallery_title_caption_wrapper').length > 0 ? item.el.find('.dipl_masonry_gallery_title_caption_wrapper').html() : ''; 51 }, 52 tError: '<a href="%url%">The image</a> could not be loaded.', 53 }, 54 allowHTMLInTemplate: true 55 } ); 56 } 57 jQuery( window ).resize( function() { 58 $gallery.isotope('layout'); 59 } ); 60}
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.