Make WordPress Core

Changeset 30361


Ignore:
Timestamp:
11/16/2014 11:11:14 PM (10 years ago)
Author:
azaozz
Message:

TinyMCE: don't show image toolbar for placeholder images. See #30147.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js

    r30318 r30361  
    99        editorWrapParent = tinymce.$( '#postdivrich' ),
    1010        tb;
     11
     12    function isPlaceholder( node ) {
     13        return !! ( editor.dom.getAttrib( node, 'data-mce-placeholder' ) || editor.dom.getAttrib( node, 'data-mce-object' ) );
     14    }
    1115
    1216    editor.addButton( 'wp_img_remove', {
     
    268272        var delay = iOS ? 350 : 100;
    269273
    270         if ( event.element.nodeName !== 'IMG' ) {
     274        if ( event.element.nodeName !== 'IMG' || isPlaceholder( event.element.nodeName ) ) {
    271275            tb.hide();
    272276            return;
     
    276280            var element = editor.selection.getNode();
    277281
    278             if ( element.nodeName === 'IMG' ) {
     282            if ( element.nodeName === 'IMG' && ! isPlaceholder( element ) ) {
    279283                if ( tb._visible ) {
    280284                    tb.reposition();
Note: See TracChangeset for help on using the changeset viewer.