diff options
Diffstat (limited to 'plugins/jetpack/modules/widgets/customizer-utils.js')
-rw-r--r-- | plugins/jetpack/modules/widgets/customizer-utils.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins/jetpack/modules/widgets/customizer-utils.js b/plugins/jetpack/modules/widgets/customizer-utils.js index 754b6339..abcf7899 100644 --- a/plugins/jetpack/modules/widgets/customizer-utils.js +++ b/plugins/jetpack/modules/widgets/customizer-utils.js @@ -8,7 +8,7 @@ * Checks whether this Customizer supports partial widget refresh. * @returns {boolean} */ -wp.customizerHasPartialWidgetRefresh = function() { +wp.customizerHasPartialWidgetRefresh = function () { return ( 'object' === typeof wp && 'function' === typeof wp.customize && @@ -24,18 +24,18 @@ wp.customizerHasPartialWidgetRefresh = function() { * @param {string} widgetName * @returns {*|boolean} */ -wp.isJetpackWidgetPlaced = function( placement, widgetName ) { +wp.isJetpackWidgetPlaced = function ( placement, widgetName ) { return placement.partial.widgetId && 0 === placement.partial.widgetId.indexOf( widgetName ); }; /** * Bind events for selective refresh in Customizer. */ -( function( $ ) { - $( document ).ready( function() { +( function ( $ ) { + $( document ).ready( function () { if ( wp && wp.customize && wp.customizerHasPartialWidgetRefresh() ) { // Refresh widget contents when a partial is rendered. - wp.customize.selectiveRefresh.bind( 'partial-content-rendered', function( placement ) { + wp.customize.selectiveRefresh.bind( 'partial-content-rendered', function ( placement ) { if ( placement.container ) { // Refresh Google+ if ( @@ -54,12 +54,12 @@ wp.isJetpackWidgetPlaced = function( placement, widgetName ) { 'object' === typeof FB.XFBML && 'function' === typeof FB.XFBML.parse ) { - FB.XFBML.parse( placement.container[ 0 ], function() { + FB.XFBML.parse( placement.container[ 0 ], function () { var $fbContainer = $( placement.container[ 0 ] ).find( '.fb_iframe_widget' ), fbWidth = $fbContainer.data( 'width' ), fbHeight = $fbContainer.data( 'height' ); $fbContainer.find( 'span' ).css( { width: fbWidth, height: fbHeight } ); - setTimeout( function() { + setTimeout( function () { $fbContainer .find( 'iframe' ) .css( { width: fbWidth, height: fbHeight, position: 'relative' } ); @@ -100,7 +100,7 @@ wp.isJetpackWidgetPlaced = function( placement, widgetName ) { } ); // Refresh widgets when they're moved. - wp.customize.selectiveRefresh.bind( 'partial-content-moved', function( placement ) { + wp.customize.selectiveRefresh.bind( 'partial-content-moved', function ( placement ) { if ( placement.container ) { // Refresh Twitter timeline iframe, since it has to be re-built. if ( |