TinyMCE: don't show image toolbar for placeholder images. See #30147.
git-svn-id: https://develop.svn.wordpress.org/trunk@30361 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
c33b85fd39
commit
d2b8163078
|
@ -9,6 +9,10 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
|
|||
editorWrapParent = tinymce.$( '#postdivrich' ),
|
||||
tb;
|
||||
|
||||
function isPlaceholder( node ) {
|
||||
return !! ( editor.dom.getAttrib( node, 'data-mce-placeholder' ) || editor.dom.getAttrib( node, 'data-mce-object' ) );
|
||||
}
|
||||
|
||||
editor.addButton( 'wp_img_remove', {
|
||||
tooltip: 'Remove',
|
||||
icon: 'dashicon dashicons-no',
|
||||
|
@ -267,7 +271,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
|
|||
editor.on( 'nodechange', function( event ) {
|
||||
var delay = iOS ? 350 : 100;
|
||||
|
||||
if ( event.element.nodeName !== 'IMG' ) {
|
||||
if ( event.element.nodeName !== 'IMG' || isPlaceholder( event.element.nodeName ) ) {
|
||||
tb.hide();
|
||||
return;
|
||||
}
|
||||
|
@ -275,7 +279,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
|
|||
setTimeout( function() {
|
||||
var element = editor.selection.getNode();
|
||||
|
||||
if ( element.nodeName === 'IMG' ) {
|
||||
if ( element.nodeName === 'IMG' && ! isPlaceholder( element ) ) {
|
||||
if ( tb._visible ) {
|
||||
tb.reposition();
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue