(function($) { $(function() { click_action ) : ?> if (typeof $.fn.magnificPopup !== 'undefined') { $('.fl-node- .fl-mosaicflow-content, .fl-node- .fl-gallery').magnificPopup({ delegate: '.fl-photo-content > a', closeBtnInside: false, type: 'image', gallery: { enabled: true, navigateByImgClick: true, }, 'image': { titleSrc: function(item) { show_captions ) : ?> text = item.el.parent().next('.fl-photo-caption').text(); return FLBuilderLayout._string_to_slug( text ); show_captions ) : ?> text = item.el.next('.fl-photo-caption').text(); return FLBuilderLayout._string_to_slug( text ); } }, callbacks: { open: function(){ layout ) : ?> if ( this.items.length > 0 ) { var parent, item, newIndex = 0, newItems = [], currItem = this.currItem, newCurrItemIndex = -1; $(this.items).each(function(i, data){ item = $(this); if ( 'undefined' !== typeof this.el ) { item = this.el; } parent = item.parents('.fl-mosaicflow-item'); newIndex = $(parent).attr('id').split('-').pop(); newIndex = newIndex > 0 ? newIndex - 1 : 0; newItems[newIndex] = this; if ( currItem.src === this.src ){ newCurrItemIndex = newIndex; } }); this.items = newItems; if ( newCurrItemIndex >= 0 ){ this.goTo( newCurrItemIndex ); } } } } }); } layout ) : ?> $('.fl-node- .fl-mosaicflow-content').one( 'mosaicflow-filled', function(){ var hash = window.location.hash.replace( '#', '' ); if ( hash != '' ) { FLBuilderLayout._scrollToElement( $( '#' + hash ) ); } if ( 'undefined' != typeof Waypoint ) { Waypoint.refreshAll(); } }).mosaicflow({ itemSelector: '.fl-mosaicflow-item', columnClass: 'fl-mosaicflow-col', minItemWidth: photo_size; ?> }); $( '.fl-node- .fl-gallery' ).imagesLoaded( function(){ $('.fl-node- .fl-gallery-item').wookmark({ align: 'center', autoResize: true, container: $('.fl-node- .fl-gallery'), offset: photo_spacing; ?>, itemWidth: 150, verticalOffset: show_captions ) ? '35' : '0'; ?> }); }); }); window._fl_string_to_slug_regex = ''; jQuery(document).ready(function(){ setTimeout(function(){ jQuery('.fl-node- .fl-mosaicflow-content').trigger('resize'); },50); }); })(jQuery);