Ticket #8978: 8978_4.patch

File 8978_4.patch, 1.9 KB (added by Garry Yao, 12 years ago)
  • _source/plugins/selection/plugin.js

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    279279                                                // have support for it, so we reproduce it here, other
    280280                                                // than firing the selection change event.
    281281
    282                                                 var savedRange,
     282                                                var savedBookmark,
    283283                                                        saveEnabled,
    284284                                                        restoreEnabled = 1;
    285285
     
    294294                                                                        return;
    295295
    296296                                                                // Give the priority to locked selection since it probably
    297                                                                 // reflects the actual situation, besides locked selection
    298                                                                 // could be interfered because of text nodes normalizing.
    299                                                                 // (#6083, #6987)
     297                                                                // reflects the actual situation. (#6083, #6987)
    300298                                                                var lockedSelection = doc.getCustomData( 'cke_locked_selection' );
    301299                                                                if ( lockedSelection )
    302300                                                                {
     
    305303                                                                }
    306304                                                                // Then check ff we have saved a range, restore it at this
    307305                                                                // point.
    308                                                                 else if ( savedRange && restoreEnabled )
     306                                                                else if ( savedBookmark && restoreEnabled )
    309307                                                                {
     308                                                                        var range = doc.getSelection().getNative().createRange();
     309                                                                        range.moveToBookmark( savedBookmark );
    310310                                                                        // Well not break because of this.
    311                                                                         try { savedRange.select(); } catch (e) {}
    312                                                                         savedRange = null;
     311                                                                        try { range.select(); } catch (e) {}
     312                                                                        savedBookmark = null;
    313313                                                                }
    314314                                                        });
    315315
     
    532532                                                                        return;
    533533                                                                }
    534534
    535                                                                 savedRange = nativeSel && sel.getRanges()[ 0 ];
     535                                                                // Create an IE Range bookmark to defeat possible text node normalization.
     536                                                                try { savedBookmark = nativeSel && nativeSel.createRange().getBookmark(); }
     537                                                                catch(er){}
    536538
    537539                                                                checkSelectionChangeTimeout.call( editor );
    538540                                                        }
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy