Make WordPress Core

Changeset 21029


Ignore:
Timestamp:
06/08/2012 06:52:44 PM (12 years ago)
Author:
ryan
Message:

Customizer: fix stuck urls and preview white screens after repeated save and activates. Props koopersmith. fixes #20868

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/js/customize-controls.dev.js

    r21028 r21029  
    695695        }());
    696696
    697         api.bind( 'activated', function() {
    698             if ( api.settings.url.activated )
    699                 window.location = api.settings.url.activated;
    700         });
    701 
    702697        // Temporary accordion code.
    703698        $('.customize-section-title').click( function( event ) {
     
    739734
    740735        // Pass events through to the parent.
    741         $.each([ 'saved', 'activated' ], function( i, id ) {
    742             api.bind( id, function() {
    743                 parent.send( id );
    744             });
     736        api.bind( 'saved', function() {
     737            parent.send( 'saved' );
     738        });
     739
     740        // When activated, let the loader handle redirecting the page.
     741        // If no loader exists, redirect the page ourselves (if a url exists).
     742        api.bind( 'activated', function() {
     743            if ( parent.targetWindow() )
     744                parent.send( 'activated', api.settings.url.activated );
     745            else if ( api.settings.url.activated )
     746                window.location = api.settings.url.activated;
    745747        });
    746748
  • trunk/wp-includes/js/customize-base.dev.js

    r21028 r21029  
    548548            var message;
    549549
    550             data = typeof data === 'undefined' ? {} : data;
     550            data = typeof data === 'undefined' ? null : data;
    551551
    552552            if ( ! this.url() || ! this.targetWindow() )
  • trunk/wp-includes/js/customize-loader.dev.js

    r21016 r21029  
    9999            });
    100100
     101            this.messenger.bind( 'activated', function( location ) {
     102                if ( location )
     103                    window.location = location;
     104            });
     105
    101106            hash = src.split('?')[1];
    102107
Note: See TracChangeset for help on using the changeset viewer.