wp/wp-includes/js/wpdialog.js
changeset 5 5e2f62d02dcd
child 9 177826044cd9
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wp/wp-includes/js/wpdialog.js	Tue Jun 09 03:35:32 2015 +0200
@@ -0,0 +1,19 @@
+( 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.focus();
+			this._trigger('refresh');
+		}
+	});
+
+	$.wp.wpdialog.prototype.options.closeOnEscape = false;
+
+})(jQuery);