mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-16 14:50:29 +00:00
Customizer: Redirect back to referrer. If referrer is a front end page, load that page in the customizer preview. Props nacin, koopersmith. fixes #20877
git-svn-id: https://develop.svn.wordpress.org/trunk@21028 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -403,7 +403,8 @@
|
||||
*/
|
||||
initialize: function( params, options ) {
|
||||
var self = this,
|
||||
rscheme = /^https?/;
|
||||
rscheme = /^https?/,
|
||||
url;
|
||||
|
||||
$.extend( this, options || {} );
|
||||
|
||||
@@ -444,6 +445,9 @@
|
||||
this.container = api.ensure( params.container );
|
||||
this.allowedUrls = params.allowedUrls;
|
||||
|
||||
url = params.url;
|
||||
delete params.url;
|
||||
|
||||
api.Messenger.prototype.initialize.call( this, params );
|
||||
|
||||
// We're dynamically generating the iframe, so the origin is set
|
||||
@@ -488,7 +492,10 @@
|
||||
return result ? result : null;
|
||||
});
|
||||
|
||||
// Refresh the preview when the URL is changed.
|
||||
// Set the url.
|
||||
this.url( url );
|
||||
|
||||
// Refresh the preview when the URL is changed (but not yet).
|
||||
this.url.bind( this.refresh );
|
||||
|
||||
this.scroll = 0;
|
||||
@@ -635,8 +642,11 @@
|
||||
} ) );
|
||||
});
|
||||
|
||||
// Load the preview frame.
|
||||
previewer.refresh();
|
||||
// Check if preview url is valid and load the preview frame.
|
||||
if ( previewer.url() )
|
||||
previewer.refresh();
|
||||
else
|
||||
previewer.url( api.settings.url.home );
|
||||
|
||||
// Save and activated states
|
||||
(function() {
|
||||
|
||||
Reference in New Issue
Block a user