mirror of
git://develop.git.wordpress.org/
synced 2025-02-26 17:42:26 +01:00
TinyMCE: ensure the wordpress
plugin is loaded before calling _createToolbar()
.
Props hauvong, azaozz. Fixes #33393. git-svn-id: https://develop.svn.wordpress.org/trunk@33728 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
3b525395cc
commit
a9b27cbc07
@ -61,14 +61,16 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
|
||||
} );
|
||||
|
||||
editor.once( 'preinit', function() {
|
||||
toolbar = editor.wp._createToolbar( [
|
||||
'wp_img_alignleft',
|
||||
'wp_img_aligncenter',
|
||||
'wp_img_alignright',
|
||||
'wp_img_alignnone',
|
||||
'wp_img_edit',
|
||||
'wp_img_remove'
|
||||
] );
|
||||
if ( editor.wp && editor.wp._createToolbar ) {
|
||||
toolbar = editor.wp._createToolbar( [
|
||||
'wp_img_alignleft',
|
||||
'wp_img_aligncenter',
|
||||
'wp_img_alignright',
|
||||
'wp_img_alignnone',
|
||||
'wp_img_edit',
|
||||
'wp_img_remove'
|
||||
] );
|
||||
}
|
||||
} );
|
||||
|
||||
editor.on( 'wptoolbar', function( event ) {
|
||||
@ -88,7 +90,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
|
||||
editor.selection.select( node );
|
||||
editor.nodeChanged();
|
||||
}, 200 );
|
||||
} else {
|
||||
} else if ( toolbar ) {
|
||||
toolbar.hide();
|
||||
}
|
||||
} );
|
||||
|
@ -136,11 +136,13 @@
|
||||
} );
|
||||
|
||||
editor.on( 'preinit', function() {
|
||||
toolbar = editor.wp._createToolbar( [
|
||||
'wp_link_preview',
|
||||
'wp_link_edit',
|
||||
'wp_link_remove'
|
||||
], true );
|
||||
if ( editor.wp && editor.wp._createToolbar ) {
|
||||
toolbar = editor.wp._createToolbar( [
|
||||
'wp_link_preview',
|
||||
'wp_link_edit',
|
||||
'wp_link_remove'
|
||||
], true );
|
||||
}
|
||||
} );
|
||||
} );
|
||||
} )( window.tinymce );
|
||||
|
@ -713,10 +713,12 @@ tinymce.PluginManager.add( 'wpview', function( editor ) {
|
||||
} );
|
||||
|
||||
editor.once( 'preinit', function() {
|
||||
toolbar = editor.wp._createToolbar( [
|
||||
'wp_view_edit',
|
||||
'wp_view_remove'
|
||||
] );
|
||||
if ( editor.wp && editor.wp._createToolbar ) {
|
||||
toolbar = editor.wp._createToolbar( [
|
||||
'wp_view_edit',
|
||||
'wp_view_remove'
|
||||
] );
|
||||
}
|
||||
} );
|
||||
|
||||
editor.on( 'wptoolbar', function( event ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user