TinyMCE: when dragging, prevent error when a range cannot be created at the drop location.
Fixes #36229. git-svn-id: https://develop.svn.wordpress.org/trunk@36983 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
4fcb429575
commit
8f8b1001ad
@ -1005,13 +1005,16 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
|
||||
rng = tinymce.dom.RangeUtils.getCaretRangeFromPoint( event.clientX, event.clientY, editor.getDoc() );
|
||||
|
||||
// Don't allow anything to be dropped in a captioned image.
|
||||
if ( dom.getParent( rng.startContainer, '.mceTemp' ) ) {
|
||||
if ( rng && dom.getParent( rng.startContainer, '.mceTemp' ) ) {
|
||||
event.preventDefault();
|
||||
} else if ( wrap ) {
|
||||
event.preventDefault();
|
||||
|
||||
editor.undoManager.transact( function() {
|
||||
editor.selection.setRng( rng );
|
||||
if ( rng ) {
|
||||
editor.selection.setRng( rng );
|
||||
}
|
||||
|
||||
editor.selection.setNode( wrap );
|
||||
dom.remove( wrap );
|
||||
} );
|
||||
|
Loading…
Reference in New Issue
Block a user