CoreFiles by mySites.guru
wpdialog.js27 lines, 560 bytes, from wordpress-5.3.21.zip
Raw History Compare with 5.3.20
md5
c6b779020a09eebd206570dcd4a90666
sha1
cc6d35e338beebd629131c8481d4d9911ba06857
sha256
b885d88c3fb1c90cdbef6c7cf3ede6c5a1471c1db1db339cdf777e9a9f072a73
/**
 * @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.focus();
			this._trigger('refresh');
		}
	});

	$.wp.wpdialog.prototype.options.closeOnEscape = false;

})(jQuery);

The same content is in 367 releases, WordPress 5.1-beta1 to 6.1.16. See them all, or every version of this file.