Changeset 1996 for FCKeditor/trunk


Ignore:
Timestamp:
05/14/08 13:57:13 (6 years ago)
Author:
fredck
Message:

Fixed #1383 : Fixed an IE issue where pressing backspace may merge a hyperlink on the previous line with the text on the current line.

Location:
FCKeditor/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/_whatsnew.html

    r1985 r1996  
    8989                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2184">#2184</a>] Fixed several validation  
    9090                        errors in the File Browser.</li> 
     91                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1383">#1383</a>] Fixed an IE issue where  
     92                        pressing backspace may merge a hyperlink on the previous line with the text on the current line.</li>  
    9193        </ul> 
    9294        <h3> 
  • FCKeditor/trunk/editor/_source/classes/fckenterkey.js

    r1729 r1996  
    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 ; 
Note: See TracChangeset for help on using the changeset viewer.
© 2003 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy