updated plugin GP Premium
version 1.11.2
This commit is contained in:
@ -3,15 +3,7 @@ jQuery( document ).ready( function( $ ) {
|
||||
var msnry = false;
|
||||
|
||||
if ( $masonry_container.length ) {
|
||||
var $grid = $masonry_container.masonry({
|
||||
columnWidth: '.grid-sizer',
|
||||
itemSelector: 'none',
|
||||
stamp: '.page-header',
|
||||
percentPosition: true,
|
||||
stagger: 30,
|
||||
visibleStyle: { transform: 'translateY(0)', opacity: 1 },
|
||||
hiddenStyle: { transform: 'translateY(5px)', opacity: 0 },
|
||||
} );
|
||||
var $grid = $masonry_container.masonry( generateBlog.masonryInit );
|
||||
|
||||
msnry = $grid.data( 'masonry' );
|
||||
|
||||
@ -37,22 +29,19 @@ jQuery( document ).ready( function( $ ) {
|
||||
var $button = $( '.load-more a' );
|
||||
var svgIcon = '';
|
||||
|
||||
if ( blog.icon ) {
|
||||
svgIcon = blog.icon;
|
||||
if ( generateBlog.icon ) {
|
||||
svgIcon = generateBlog.icon;
|
||||
}
|
||||
|
||||
$container.infiniteScroll( {
|
||||
path: '.nav-links .next',
|
||||
append: '#main article',
|
||||
history: false,
|
||||
outlayer: msnry,
|
||||
loadOnScroll: $button.length ? false : true,
|
||||
button: $button.length ? '.load-more a' : null,
|
||||
scrollThreshold: $button.length ? false : 600,
|
||||
} );
|
||||
var infiniteScrollInit = generateBlog.infiniteScrollInit;
|
||||
|
||||
infiniteScrollInit.outlayer = msnry;
|
||||
|
||||
$container.infiniteScroll( infiniteScrollInit );
|
||||
|
||||
$button.on( 'click', function( e ) {
|
||||
$( this ).html( svgIcon + blog.loading ).addClass( 'loading' );
|
||||
document.activeElement.blur();
|
||||
$( this ).html( svgIcon + generateBlog.loading ).addClass( 'loading' );
|
||||
} );
|
||||
|
||||
$container.on( 'append.infiniteScroll', function( event, response, path, items ) {
|
||||
@ -60,8 +49,11 @@ jQuery( document ).ready( function( $ ) {
|
||||
$container.append( $button.parent() );
|
||||
}
|
||||
|
||||
// Fix srcset images not loading in Safari.
|
||||
// img.outerHTML = img.outerHTML isn't minified properly, so we need the extra var.
|
||||
$( items ).find( 'img' ).each( function( index, img ) {
|
||||
img.outerHTML = img.outerHTML;
|
||||
var imgOuterHTML = img.outerHTML;
|
||||
img.outerHTML = imgOuterHTML;
|
||||
} );
|
||||
|
||||
if ( $grid ) {
|
||||
@ -70,7 +62,7 @@ jQuery( document ).ready( function( $ ) {
|
||||
} );
|
||||
}
|
||||
|
||||
$button.html( svgIcon + blog.more ).removeClass( 'loading' );
|
||||
$button.html( svgIcon + generateBlog.more ).removeClass( 'loading' );
|
||||
} );
|
||||
|
||||
$container.on( 'last.infiniteScroll', function() {
|
||||
|
Reference in New Issue
Block a user