1/** 2 * Justified Gallery 3 */ 4( function( $ ) { 5 6 function powerkitInitJustifiedGallery() { 7 8 $( '.gallery-type-justified:not(.gallery-type-justified-ready)' ).imagesLoaded( function( instance ) { 9 10 $( instance.elements ).each( function( index, el ) { 11 var $el = $( el ); 12 var data = $el.data(); 13 14 $el.filter(':not(.gallery-type-justified-ready)') 15 .addClass( 'gallery-type-justified-ready' ) 16 .justifiedGallery( { 17 rtl: !!powerkitJG.rtl, 18 margins: data.jgMargins, 19 rowHeight: data.jgRowHeight, 20 maxRowHeight: data.jgMaxRowHeight, 21 lastRow: data.jgLastRow, 22 border: 0, 23 border: typeof data.jgBorder !== 'undefined' ? data.jgBorder : 0, 24 selector: 'figure', 25 captions: typeof data.jgCaptions !== 'undefined' ? data.jgCaptions : true, 26 randomize: typeof data.jgRandomize !== 'undefined' ? data.jgRandomize : false, 27 cssAnimation: true, 28 captionSettings: { 29 animationDuration: 100, 30 visibleOpacity: 1.0, 31 nonVisibleOpacity: 0.0 32 } 33 } ).on( 'jg.complete', function( e ) { 34 35 $el.addClass( 'justified-loaded' ); 36 37 $( document.body ).trigger( 'image-load' ); 38 } ); 39 } ); 40 41 } ); 42 } 43 44 $( document ).ready( function() { 45 powerkitInitJustifiedGallery(); 46 $( document.body ).on( 'post-load', function() { 47 powerkitInitJustifiedGallery(); 48 } ); 49 50 if ( 'undefined' !== typeof wp && 'undefined' !== typeof wp.hooks ) { 51 wp.hooks.addAction( 'canvas.components.serverSideRender.onChange', 'canvas/justified-gallery.init', function( props ) { 52 if ( 'canvas/justified-gallery' === props.block ) { 53 powerkitInitJustifiedGallery(); 54 } 55 } ); 56 } 57 } ); 58 59} )( jQuery );
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.