Theme Customizer: Fix race condition in previewer and use message channels. Props koopersmith. fixes #20811

git-svn-id: https://develop.svn.wordpress.org/trunk@20988 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2012-06-04 15:51:46 +00:00
parent f136fa9c99
commit 06c0450892
5 changed files with 235 additions and 85 deletions
+5 -1
View File
@@ -77,7 +77,11 @@ if ( typeof wp === 'undefined' )
this.iframe.one( 'load', this.loaded );
// Create a postMessage connection with the iframe.
this.messenger = new api.Messenger( src, this.iframe[0].contentWindow );
this.messenger = new api.Messenger({
url: src,
channel: 'loader',
targetWindow: this.iframe[0].contentWindow
});
// Wait for the connection from the iframe before sending any postMessage events.
this.messenger.bind( 'ready', function() {