Make WordPress Core

Changeset 36983


Ignore:
Timestamp:
03/13/2016 10:55:01 PM (11 years ago)
Author:
azaozz
Message:

TinyMCE: when dragging, prevent error when a range cannot be created at the drop location.

Fixes #36229.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js

    r36376 r36983  
    10061006
    10071007                        // Don't allow anything to be dropped in a captioned image.
    1008                         if ( dom.getParent( rng.startContainer, '.mceTemp' ) ) {
     1008                        if ( rng && dom.getParent( rng.startContainer, '.mceTemp' ) ) {
    10091009                                event.preventDefault();
    10101010                        } else if ( wrap ) {
     
    10121012
    10131013                                editor.undoManager.transact( function() {
    1014                                         editor.selection.setRng( rng );
     1014                                        if ( rng ) {
     1015                                                editor.selection.setRng( rng );
     1016                                        }
     1017
    10151018                                        editor.selection.setNode( wrap );
    10161019                                        dom.remove( wrap );
Note: See TracChangeset for help on using the changeset viewer.