author | ymh <ymh.work@gmail.com> |
Fri, 05 Sep 2025 18:52:52 +0200 | |
changeset 22 | 8c2e4d02f4ef |
parent 21 | 48c4eec2b7e6 |
permissions | -rw-r--r-- |
9 | 1 |
/** |
2 |
* @output wp-includes/js/wpdialog.js |
|
3 |
*/ |
|
4 |
||
5 |
/* |
|
6 |
* Wrap the jQuery UI Dialog open function remove focus from tinyMCE. |
|
7 |
*/ |
|
5 | 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(); |
|
9 | 18 |
|
5 | 19 |
// WebKit leaves focus in the TinyMCE editor unless we shift focus. |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
9
diff
changeset
|
20 |
this.element.trigger('focus'); |
5 | 21 |
this._trigger('refresh'); |
22 |
} |
|
23 |
}); |
|
24 |
||
25 |
$.wp.wpdialog.prototype.options.closeOnEscape = false; |
|
26 |
||
27 |
})(jQuery); |