diff options
Diffstat (limited to 'wp-includes/js/wpdialog.js')
-rw-r--r-- | wp-includes/js/wpdialog.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/wp-includes/js/wpdialog.js b/wp-includes/js/wpdialog.js new file mode 100644 index 0000000..0da56f5 --- /dev/null +++ b/wp-includes/js/wpdialog.js @@ -0,0 +1,27 @@ +/** + * @output wp-includes/js/wpdialog.js + */ + +/* + * Wrap the jQuery UI Dialog open function remove focus from tinyMCE. + */ +( function($) { + $.widget('wp.wpdialog', $.ui.dialog, { + open: function() { + // Add beforeOpen event. + if ( this.isOpen() || false === this._trigger('beforeOpen') ) { + return; + } + + // Open the dialog. + this._super(); + + // WebKit leaves focus in the TinyMCE editor unless we shift focus. + this.element.trigger('focus'); + this._trigger('refresh'); + } + }); + + $.wp.wpdialog.prototype.options.closeOnEscape = false; + +})(jQuery); |