Ticket #1383: 1383_2.patch

File 1383_2.patch, 1.7 KB (added by fredck, 23 months ago)
  • _whatsnew.html

     
    7171                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2125">#2125</a>] Fixed the issue that  
    7272                        FCK.InsertHtml() doesn't insert contents at the caret position when dialogs are opened in IE. 
    7373                        </li> 
     74                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1383">#1383</a>] Fixed an IE issue where  
     75                        pressing backspace may merge a hyperlink on the previous line with the text on the current line.</li>  
    7476        </ul> 
    7577        <h3> 
    7678                Version 2.6</h3> 
  • editor/_source/classes/fckenterkey.js

     
    168168                return false ; 
    169169        } 
    170170 
     171        // On IE, it is better for us handle the deletion if the caret is preceeded 
     172        // by a <br> (#1383). 
     173        if ( FCKBrowserInfo.IsIE ) 
     174        { 
     175                var previousElement = FCKDomTools.GetPreviousSourceElement( oRange.StartNode, true ) ; 
     176 
     177                if ( previousElement && previousElement.nodeName.toLowerCase() == 'br' ) 
     178                { 
     179                        // Create a range that starts after the <br> and ends at the 
     180                        // current range position. 
     181                        var testRange = oRange.Clone() ; 
     182                        testRange.SetStart( previousElement, 4 ) ; 
     183 
     184                        // If that range is empty, we can proceed cleaning that <br> manually. 
     185                        if ( testRange.CheckIsEmpty() ) 
     186                        { 
     187                                previousElement.parentNode.removeChild( previousElement ) ; 
     188                                return true ; 
     189                        } 
     190                } 
     191        } 
     192 
    171193        var oStartBlock = oRange.StartBlock ; 
    172194        var oEndBlock = oRange.EndBlock ; 
    173195