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

git-svn-id: https://develop.svn.wordpress.org/trunk@27451 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2014-03-07 06:33:06 +00:00
parent 43a8fb1bd2
commit 5e5caca113

View File

@ -774,15 +774,13 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
});
editor.on( 'mousedown', function( event ) {
var node = event.target;
if ( tinymce.Env.ie && editor.dom.getParent( node, '#wp-image-toolbar' ) ) {
if ( editor.dom.getParent( event.target, '#wp-image-toolbar' ) ) {
if ( tinymce.Env.ie ) {
// Stop IE > 8 from making the wrapper resizable on mousedown
event.preventDefault();
}
if ( node.nodeName === 'IMG' && ! editor.dom.getAttrib( node, 'data-wp-imgselect' ) && ! isPlaceholder( node ) ) {
addToolbar( node );
} else if ( event.target.nodeName !== 'IMG' ) {
removeToolbar();
}
});
@ -809,6 +807,8 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
editImage( image );
}
}
} else if ( node.nodeName === 'IMG' && ! editor.dom.getAttrib( node, 'data-wp-imgselect' ) && ! isPlaceholder( node ) ) {
addToolbar( node );
} else if ( node.nodeName !== 'IMG' ) {
removeToolbar();
}