Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/jetpack/modules/infinite...
File: infinity-customizer.js
( function ( $ ) {
[0] Fix | Delete
/**
[1] Fix | Delete
* Ready, set, go!
[2] Fix | Delete
*/
[3] Fix | Delete
$( document ).ready( function () {
[4] Fix | Delete
// Integrate with Selective Refresh in the Customizer.
[5] Fix | Delete
if ( 'undefined' !== typeof wp && wp.customize && wp.customize.selectiveRefresh ) {
[6] Fix | Delete
/**
[7] Fix | Delete
* Handle rendering of selective refresh partials.
[8] Fix | Delete
*
[9] Fix | Delete
* Make sure that when a partial is rendered, the Jetpack post-load event
[10] Fix | Delete
* will be triggered so that any dynamic elements will be re-constructed,
[11] Fix | Delete
* such as ME.js elements, Photon replacements, social sharing, and more.
[12] Fix | Delete
* Note that this is applying here not strictly to posts being loaded.
[13] Fix | Delete
* If a widget contains a ME.js element and it is previewed via selective
[14] Fix | Delete
* refresh, the post-load would get triggered allowing any dynamic elements
[15] Fix | Delete
* therein to also be re-constructed.
[16] Fix | Delete
*
[17] Fix | Delete
* @param {wp.customize.selectiveRefresh.Placement} placement
[18] Fix | Delete
*/
[19] Fix | Delete
wp.customize.selectiveRefresh.bind( 'partial-content-rendered', function ( placement ) {
[20] Fix | Delete
var content;
[21] Fix | Delete
if ( 'string' === typeof placement.addedContent ) {
[22] Fix | Delete
content = placement.addedContent;
[23] Fix | Delete
} else if ( placement.container ) {
[24] Fix | Delete
content = $( placement.container ).html();
[25] Fix | Delete
}
[26] Fix | Delete
[27] Fix | Delete
if ( content ) {
[28] Fix | Delete
$( document.body ).trigger( 'post-load', { html: content } );
[29] Fix | Delete
}
[30] Fix | Delete
} );
[31] Fix | Delete
[32] Fix | Delete
/*
[33] Fix | Delete
* Add partials for posts added via infinite scroll.
[34] Fix | Delete
*
[35] Fix | Delete
* This is unnecessary when MutationObserver is supported by the browser
[36] Fix | Delete
* since then this will be handled by Selective Refresh in core.
[37] Fix | Delete
*/
[38] Fix | Delete
if ( 'undefined' === typeof MutationObserver ) {
[39] Fix | Delete
$( document.body ).on( 'post-load', function ( e, response ) {
[40] Fix | Delete
var rootElement = null;
[41] Fix | Delete
if ( response.html && -1 !== response.html.indexOf( 'data-customize-partial' ) ) {
[42] Fix | Delete
if ( window.infiniteScroll.settings.id ) {
[43] Fix | Delete
rootElement = $( '#' + window.infiniteScroll.settings.id );
[44] Fix | Delete
}
[45] Fix | Delete
wp.customize.selectiveRefresh.addPartials( rootElement );
[46] Fix | Delete
}
[47] Fix | Delete
} );
[48] Fix | Delete
}
[49] Fix | Delete
}
[50] Fix | Delete
} );
[51] Fix | Delete
} )( jQuery ); // Close closure
[52] Fix | Delete
[53] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function