WordPress.org

Make WordPress Core

Ticket #52046: 52046.diff

File 52046.diff, 1.0 KB (added by azaozz, 11 months ago)
  • src/js/_enqueues/vendor/tinymce/plugins/wordpress/plugin.js

     
    1616                wpTooltips = false;
    1717
    1818        if ( $ ) {
     19                // Runs as soon as TinyMCE has started initializing, while plugins are loading.
     20                // Handlers attached after the `tinymce.init()` call may not get triggered for this instance.
    1921                $( document ).triggerHandler( 'tinymce-editor-setup', [ editor ] );
    2022        }
    2123
     
    540542                });
    541543
    542544                if ( $ ) {
    543                         $( document ).triggerHandler( 'tinymce-editor-init', [editor] );
     545                        // Run on DOM ready. Otherwise TinyMCE may initialize earlier and handlers attached
     546                        // on DOM ready of after the `tinymce.init()` call may not get triggered.
     547                        $( function() {
     548                                $( document ).triggerHandler( 'tinymce-editor-init', [editor] );
     549                        });
    544550                }
    545551
    546552                if ( window.tinyMCEPreInit && window.tinyMCEPreInit.dragDropUpload ) {