balmet.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

wpdialog.js (560B)


      1 /**
      2  * @output wp-includes/js/wpdialog.js
      3  */
      4 
      5 /*
      6  * Wrap the jQuery UI Dialog open function remove focus from tinyMCE.
      7  */
      8 ( function($) {
      9 	$.widget('wp.wpdialog', $.ui.dialog, {
     10 		open: function() {
     11 			// Add beforeOpen event.
     12 			if ( this.isOpen() || false === this._trigger('beforeOpen') ) {
     13 				return;
     14 			}
     15 
     16 			// Open the dialog.
     17 			this._super();
     18 
     19 			// WebKit leaves focus in the TinyMCE editor unless we shift focus.
     20 			this.element.focus();
     21 			this._trigger('refresh');
     22 		}
     23 	});
     24 
     25 	$.wp.wpdialog.prototype.options.closeOnEscape = false;
     26 
     27 })(jQuery);