mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-10 18:37:58 +01:00
TinyMCE: don't show image toolbar for placeholder images. See #30147.
Built from https://develop.svn.wordpress.org/trunk@30361 git-svn-id: http://core.svn.wordpress.org/trunk@30360 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
7cdbac53e8
commit
22b760088c
@ -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 {
|
||||
|
File diff suppressed because one or more lines are too long
Binary file not shown.
Loading…
Reference in New Issue
Block a user