Ticket #1522: 1522.patch

File 1522.patch, 1.8 KB (added by Martin Kou, 16 years ago)

Proposed fix for #1522 using the local approach.

  • editor/_source/classes/fckdomrange_ie.js

     
    109109                oIERange.setEndPoint( 'EndToEnd', oIERangeEnd ) ;
    110110                oIERange.moveEnd( 'character', -1 ) ;
    111111        }
    112         else
     112       
     113        if ( oIERange.text.length == 0 && oIERange.boundingWidth == 0 )
    113114        {
    114115                bIsStartMakerAlone = ( forceExpand || !eStartMarker.previousSibling || eStartMarker.previousSibling.nodeName.toLowerCase() == 'br' ) && !eStartMarker.nextSibing ;
    115116               
    116                 // Append a temporary <span>&nbsp;</span> before the selection.
     117                // Append a temporary <span>&#65279;</span> before the selection.
    117118                // This is needed to avoid IE destroying selections inside empty
    118119                // inline elements, like <b></b> (#253).
    119120                // It is also needed when placing the selection right after an inline
     
    139140        this._Range.setStartBefore( eStartMarker ) ;
    140141        eStartMarker.parentNode.removeChild( eStartMarker ) ;
    141142
    142         if ( bIsCollapsed )
     143        if ( eEndMarker )
    143144        {
     145                this._Range.setEndBefore( eEndMarker ) ;
     146                eEndMarker.parentNode.removeChild( eEndMarker ) ;
     147                oIERange.select() ;
     148        }
     149
     150        if ( dummySpan )
     151        {
    144152                if ( bIsStartMakerAlone )
    145153                {
    146                         // Move the selection start to include the temporary &nbsp;.
     154                        // Move the selection start to include the temporary &#65279;.
    147155                        oIERange.moveStart( 'character', -1 ) ;
    148156                       
    149157                        oIERange.select() ;
     
    156164
    157165                FCKDomTools.RemoveNode( dummySpan ) ;
    158166        }
    159         else
    160         {
    161                 this._Range.setEndBefore( eEndMarker ) ;
    162                 eEndMarker.parentNode.removeChild( eEndMarker ) ;
    163                 oIERange.select() ;
    164         }
    165167}
    166168
    167169FCKDomRange.prototype._GetSelectionMarkerTag = function( toStart )
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy