+/*
+ * Script run inside a Customizer preview frame.
+ */
(function( exports, $ ){
var api = wp.customize,
debounce;
*/
api.Preview = api.Messenger.extend({
/**
- * Requires params:
- * - url - the URL of preview frame
+ * @param {string} url The URL of preview frame
*/
initialize: function( params, options ) {
var self = this;
api.preview.send( 'documentTitle', document.title );
});
+ /*
+ * Send a message to the parent customize frame with a list of which
+ * containers and controls are active.
+ */
api.preview.send( 'ready', {
activePanels: api.settings.activePanels,
activeSections: api.settings.activeSections,
// Display a loading indicator when preview is reloading, and remove on failure.
api.preview.bind( 'loading-initiated', function () {
$( 'body' ).addClass( 'wp-customizer-unloading' );
- $( 'html' ).prop( 'title', api.settings.l10n.loading );
});
api.preview.bind( 'loading-failed', function () {
$( 'body' ).removeClass( 'wp-customizer-unloading' );
- $( 'html' ).prop( 'title', '' );
});
/* Custom Backgrounds */