Make WordPress Core

Changeset 27451


Ignore:
Timestamp:
03/07/2014 06:33:06 AM (11 years ago)
Author:
azaozz
Message:

TinyMCE editimage: show the toolbar on mouseup to avoid accidental clicks on the buttons, fixes #24409

File:
1 edited

Legend:

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

    r27426 r27451  
    775775
    776776    editor.on( 'mousedown', function( event ) {
    777         var node = event.target;
    778 
    779         if ( tinymce.Env.ie && editor.dom.getParent( node, '#wp-image-toolbar' ) ) {
    780             // Stop IE > 8 from making the wrapper resizable on mousedown
    781             event.preventDefault();
    782         }
    783 
    784         if ( node.nodeName === 'IMG' && ! editor.dom.getAttrib( node, 'data-wp-imgselect' ) && ! isPlaceholder( node ) ) {
    785             addToolbar( node );
     777        if ( editor.dom.getParent( event.target, '#wp-image-toolbar' ) ) {
     778            if ( tinymce.Env.ie ) {
     779                // Stop IE > 8 from making the wrapper resizable on mousedown
     780                event.preventDefault();
     781            }
     782        } else if ( event.target.nodeName !== 'IMG' ) {
     783            removeToolbar();
    786784        }
    787785    });
     
    810808                }
    811809            }
     810        } else if ( node.nodeName === 'IMG' && ! editor.dom.getAttrib( node, 'data-wp-imgselect' ) && ! isPlaceholder( node ) ) {
     811            addToolbar( node );
    812812        } else if ( node.nodeName !== 'IMG' ) {
    813813            removeToolbar();
Note: See TracChangeset for help on using the changeset viewer.