mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-24 10:09:47 +01:00
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:
parent
52fdb09e2d
commit
88a47ecd06
@ -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
Binary file not shown.
Loading…
Reference in New Issue
Block a user