From fff67f819c5d8add0fffaae9046becaafce406c8 Mon Sep 17 00:00:00 2001 From: Daryl Koopersmith Date: Wed, 29 Feb 2012 22:24:46 +0000 Subject: [PATCH] Theme Customizer: Bind the preview iframe load event when triggering refresh instead of when creating the iframe. see #19910. The loaded event should only fire when we've actually triggered a refresh. If loaded is bound when the iframe is created, sometimes the blank iframe will fire a 'load' event before a refresh is triggered (this occurred with relative frequency in firefox). By binding the loaded event in the refresh function, we prevent this from occurring. git-svn-id: https://develop.svn.wordpress.org/trunk@20049 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/js/customize-controls.dev.js | 25 ++++++++++++------------ 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/wp-includes/js/customize-controls.dev.js b/wp-includes/js/customize-controls.dev.js index d66b10a319..cfe66bb4d3 100644 --- a/wp-includes/js/customize-controls.dev.js +++ b/wp-includes/js/customize-controls.dev.js @@ -13,6 +13,8 @@ initialize: function( params, options ) { $.extend( this, options || {} ); + this.loaded = $.proxy( this.loaded, this ); + this.loaderUuid = 0; /* @@ -53,6 +55,7 @@ this.iframe = api.ensure( params.iframe ); this.form = api.ensure( params.form ); + this.name = this.iframe.prop('name'); this.container = this.iframe.parent(); @@ -83,28 +86,24 @@ }); }, loader: function() { - var self = this, - name; - if ( this.loading ) return this.loading; - name = this.iframe.prop('name'); - this.loading = $('