mirror of
git://develop.git.wordpress.org/
synced 2025-03-19 11:29:48 +01:00
Editor: Trigger the tinymce-editor-init
custom jQuery event on DOM ready.
Otherwise TinyMCE may initialize earlier and handlers attached on DOM ready may not get triggered. Fixes making the editor menu "sticky" and setting/resetting some screen options on the old Edit Post screen. Props azaozz, majhajob, sabernhardt. Merges [49911] to the 5.6 branch. Fixes #52046, #51995. git-svn-id: https://develop.svn.wordpress.org/branches/5.6@49996 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
902c6d5be0
commit
53caadeaa7
@ -16,6 +16,8 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
|
||||
wpTooltips = false;
|
||||
|
||||
if ( $ ) {
|
||||
// Runs as soon as TinyMCE has started initializing, while plugins are loading.
|
||||
// Handlers attached after the `tinymce.init()` call may not get triggered for this instance.
|
||||
$( document ).triggerHandler( 'tinymce-editor-setup', [ editor ] );
|
||||
}
|
||||
|
||||
@ -540,7 +542,11 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
|
||||
});
|
||||
|
||||
if ( $ ) {
|
||||
$( document ).triggerHandler( 'tinymce-editor-init', [editor] );
|
||||
// Run on DOM ready. Otherwise TinyMCE may initialize earlier and handlers attached
|
||||
// on DOM ready of after the `tinymce.init()` call may not get triggered.
|
||||
$( function() {
|
||||
$( document ).triggerHandler( 'tinymce-editor-init', [editor] );
|
||||
});
|
||||
}
|
||||
|
||||
if ( window.tinyMCEPreInit && window.tinyMCEPreInit.dragDropUpload ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user