mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
git-svn-id: https://develop.svn.wordpress.org/trunk@17933 602fd350-edb4-49c9-b593-d223f7449a82
24 lines
636 B
JavaScript
24 lines
636 B
JavaScript
(function($){
|
|
$.widget("wp.wpdialog", $.ui.dialog, {
|
|
open: function() {
|
|
var ed;
|
|
|
|
// Initialize tinyMCEPopup if it exists and is the editor is active.
|
|
if ( tinyMCEPopup && typeof tinyMCE != 'undefined' && ( ed = tinyMCE.activeEditor ) && !ed.isHidden() ) {
|
|
tinyMCEPopup.init();
|
|
}
|
|
|
|
// Add beforeOpen event.
|
|
if ( this._isOpen || false === this._trigger('beforeOpen') ) {
|
|
return;
|
|
}
|
|
|
|
// Open the dialog.
|
|
$.ui.dialog.prototype.open.apply( this, arguments );
|
|
// WebKit leaves focus in the TinyMCE editor unless we shift focus.
|
|
this.element.focus();
|
|
this._trigger('refresh');
|
|
}
|
|
});
|
|
})(jQuery);
|