Changeset 20517
- Timestamp:
- 04/18/2012 08:25:31 PM (13 years ago)
- Location:
- trunk/wp-includes/js
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/customize-base.dev.js
r20476 r20517 432 432 433 433 url = this.add( 'url', url ); 434 this.add( 'targetWindow', targetWindow || null);434 this.add( 'targetWindow', targetWindow || window.parent ); 435 435 this.add( 'origin', url() ).link( url ).setter( function( to ) { 436 436 return to.replace( /([^:]+:\/\/[^\/]+).*/, '$1' ); … … 439 439 this.topics = {}; 440 440 441 $.receiveMessage( $.proxy( this.receive, this ), this.origin() || null ); 441 this.receive = $.proxy( this.receive, this ); 442 $( window ).on( 'message', this.receive ); 443 }, 444 445 destroy: function() { 446 $( window ).off( 'message', this.receive ); 442 447 }, 443 448 … … 445 450 var message; 446 451 447 // @todo: remove, this is done in the postMessage plugin. 448 // if ( this.origin && event.origin !== this.origin ) 449 // return; 452 event = event.originalEvent; 453 454 // Check to make sure the origin is valid. 455 if ( this.origin() && event.origin !== this.origin() ) 456 return; 450 457 451 458 message = JSON.parse( event.data ); … … 464 471 465 472 message = JSON.stringify({ id: id, data: data }); 466 $.postMessage( message, this.url(), this.targetWindow() );473 this.targetWindow().postMessage( message, this.origin() ); 467 474 }, 468 475 -
trunk/wp-includes/js/customize-loader.dev.js
r20488 r20517 44 44 Loader.open( wpCustomizeLoaderL10n.url + '?' + hash ); 45 45 46 if ( ! hash )46 if ( ! hash && ! Loader.supports.history ) 47 47 Loader.close(); 48 48 }, … … 79 79 if ( Loader.supports.history && window.location.href !== src ) 80 80 history.pushState( { customize: src }, '', src ); 81 else if ( Loader.supports.hashchange && hash )81 else if ( ! Loader.supports.history && Loader.supports.hashchange && hash ) 82 82 window.location.hash = hash; 83 83 }); … … 90 90 this.element.fadeOut( 200, function() { 91 91 Loader.iframe.remove(); 92 Loader.messenger.destroy(); 92 93 Loader.iframe = null; 93 94 Loader.messenger = null;
Note: See TracChangeset
for help on using the changeset viewer.