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

Built from https://develop.svn.wordpress.org/trunk@27451


git-svn-id: http://core.svn.wordpress.org/trunk@27297 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2014-03-07 06:34:14 +00:00
parent 52fdb09e2d
commit 88a47ecd06
3 changed files with 10 additions and 10 deletions

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();
}

File diff suppressed because one or more lines are too long