* Allows the Customizer to be overlayed on any page.
*
* By default, any element in the body with the load-customize class will open
* Allows the Customizer to be overlayed on any page.
*
* By default, any element in the body with the load-customize class will open
this.saved = new api.Value( true );
this.iframe = $( '<iframe />', { src: src }).appendTo( this.element );
this.saved = new api.Value( true );
this.iframe = $( '<iframe />', { src: src }).appendTo( this.element );
// Prompt AYS dialog when navigating away
$( window ).on( 'beforeunload', this.beforeunload );
// Prompt AYS dialog when navigating away
$( window ).on( 'beforeunload', this.beforeunload );
// Ensure we don't call pushState if the user hit the forward button.
if ( $.support.history && window.location.href !== src ) {
history.pushState( { customize: src }, '', src );
} else if ( ! $.support.history && $.support.hashchange && hash ) {
// Ensure we don't call pushState if the user hit the forward button.
if ( $.support.history && window.location.href !== src ) {
history.pushState( { customize: src }, '', src );
} else if ( ! $.support.history && $.support.hashchange && hash ) {
if ( ! this.saved() && ! confirm( Loader.settings.l10n.saveAlert ) ) {
// Go forward since Customizer is exited by history.back()
history.forward();
if ( ! this.saved() && ! confirm( Loader.settings.l10n.saveAlert ) ) {
// Go forward since Customizer is exited by history.back()
history.forward();