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:
parent
43a8fb1bd2
commit
5e5caca113
@ -774,15 +774,13 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
editor.on( 'mousedown', function( event ) {
|
editor.on( 'mousedown', function( event ) {
|
||||||
var node = event.target;
|
if ( editor.dom.getParent( event.target, '#wp-image-toolbar' ) ) {
|
||||||
|
if ( tinymce.Env.ie ) {
|
||||||
if ( tinymce.Env.ie && editor.dom.getParent( node, '#wp-image-toolbar' ) ) {
|
// Stop IE > 8 from making the wrapper resizable on mousedown
|
||||||
// Stop IE > 8 from making the wrapper resizable on mousedown
|
event.preventDefault();
|
||||||
event.preventDefault();
|
}
|
||||||
}
|
} else if ( event.target.nodeName !== 'IMG' ) {
|
||||||
|
removeToolbar();
|
||||||
if ( node.nodeName === 'IMG' && ! editor.dom.getAttrib( node, 'data-wp-imgselect' ) && ! isPlaceholder( node ) ) {
|
|
||||||
addToolbar( node );
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -809,6 +807,8 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
|
|||||||
editImage( image );
|
editImage( image );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if ( node.nodeName === 'IMG' && ! editor.dom.getAttrib( node, 'data-wp-imgselect' ) && ! isPlaceholder( node ) ) {
|
||||||
|
addToolbar( node );
|
||||||
} else if ( node.nodeName !== 'IMG' ) {
|
} else if ( node.nodeName !== 'IMG' ) {
|
||||||
removeToolbar();
|
removeToolbar();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user