mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-12-03 19:41:39 +00:00
Theme Customizer: Allow the customize iframe to be accessed directly (with full feature support). see #19910.
* Move the 'Return to Manage Themes' and 'Collapse Sidebar' actions from themes.php to customize-controls.php. * Create a postMessage connection between themes.php and customize-controls.php. * Allow the theme customizer to be accessed directly (independent of themes.php and the customize loader). * Add wp_customize_href() and wp_customize_url(). * Remove wp_customize_loader(). To include the loader, use wp_enqueue_script( 'customize-loader' ). * The theme customizer now requires postMessage browser support. * Add .hide-if-customize and .hide-if-no-customize CSS classes. * Clean up customize-preview.js. git-svn-id: https://develop.svn.wordpress.org/trunk@20476 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -13,9 +13,7 @@
|
||||
initialize: function( url, options ) {
|
||||
var self = this;
|
||||
|
||||
$.extend( this, options || {} );
|
||||
|
||||
api.Messenger.prototype.initialize.call( this, url );
|
||||
api.Messenger.prototype.initialize.call( this, url, null, options );
|
||||
|
||||
this.body = $( document.body );
|
||||
this.body.on( 'click.preview', 'a', function( event ) {
|
||||
@@ -29,24 +27,6 @@
|
||||
this.body.on( 'submit.preview', 'form', function( event ) {
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
this.bind( 'url', function( url ) {
|
||||
this.url( url );
|
||||
this.refresh();
|
||||
});
|
||||
},
|
||||
refresh: function() {
|
||||
this.submit({
|
||||
target: this.iframe.prop('name'),
|
||||
action: this.url()
|
||||
});
|
||||
},
|
||||
submit: function( props ) {
|
||||
if ( props )
|
||||
this.form.prop( props );
|
||||
this.form.submit();
|
||||
if ( props )
|
||||
this.form.prop( this._formOriginalProps );
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user