Ticket #4734: 4734_2.patch

File 4734_2.patch, 1.2 KB (added by Garry Yao, 14 years ago)
  • _source/plugins/selection/plugin.js

     
    209209                                                        if ( saveEnabled )
    210210                                                        {
    211211                                                                var doc = editor.document,
    212                                                                         sel = doc && doc.$.selection;
     212                                                                        sel = editor.getSelection(),
     213                                                                        nativeSel = sel && sel.getNative();
    213214
    214215                                                                // There is a very specific case, when clicking
    215216                                                                // inside a text selection. In that case, the
     
    219220                                                                // range at the very start of the document. In
    220221                                                                // such situation we have to test the range, to
    221222                                                                // be sure it's valid.
    222                                                                 if ( testIt && sel && sel.type == 'None' )
     223                                                                if ( testIt && nativeSel && nativeSel.type == 'None' )
    223224                                                                {
    224225                                                                        // The "InsertImage" command can be used to
    225226                                                                        // test whether the selection is good or not.
     
    232233                                                                        }
    233234                                                                }
    234235
    235                                                                 savedRange = sel && sel.createRange();
     236                                                                savedRange = nativeSel && sel.getRanges()[ 0 ];
    236237
    237238                                                                checkSelectionChangeTimeout.call( editor );
    238239                                                        }
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy