Ticket #1383: 1383.patch

File 1383.patch, 2.9 KB (added by Martin Kou, 16 years ago)
  • _whatsnew.html

     
    5353                        in the Find/Replace dialog.</li>
    5454                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2124">#2124</a>] PHP file brower: fixed
    5555                        issue with resolving paths on Windows servers with PHP 5.2.4/5.2.5.</li>
     56                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1383">#1383</a>] Fixed an IE issue where
     57                        pressing backspace may merge a hyperlink on the previous line with the text on the current line.
     58                        </li>
    5659        </ul>
    5760        <h3>
    5861                Version 2.6</h3>
  • editor/_source/classes/fckenterkey.js

     
    168168                return false ;
    169169        }
    170170
     171        // Kludge for #1383
     172        if ( FCKBrowserInfo.IsIE && isCollapsed )
     173        {
     174                var endContainer = oRange._Range.endContainer ;
     175                var endOffset = oRange._Range.endOffset ;
     176                var startNode = oRange.StartNode ;
     177
     178                var returnNow = (function()
     179                {
     180                        var brNode = null ;
     181                        if ( endContainer.nodeType == 3 )
     182                        {
     183                                if ( endOffset > 0 )
     184                                        return false ;
     185
     186                                var currentNode = endContainer ;
     187                                var commonParent = FCKDomTools.GetCommonParents( endContainer, startNode ).pop() ;
     188                                while ( FCKDomTools.CheckIsEditable( currentNode.parentNode )
     189                                                && currentNode == currentNode.parentNode.childNodes[0]
     190                                                && currentNode.parentNode != commonParent )
     191                                        currentNode = currentNode.parentNode ;
     192
     193                                if ( currentNode.previousSibling && currentNode.previousSibling.nodeName.IEquals( 'br' ) )
     194                                        brNode = currentNode.previousSibling ;
     195                        }
     196                        else if ( endContainer.nodeType == 1 )
     197                        {
     198                                var currentNode = endContainer.childNodes[ endOffset ] || endContainer.childNodes[ endOffset - 1 ] ;
     199                                var commonParent = FCKDomTools.GetCommonParents( currentNode, startNode ).pop() ;
     200                                while ( FCKDomTools.CheckIsEditable( currentNode.parentNode )
     201                                                && currentNode == currentNode.parentNode.childNodes[0]
     202                                                && currentNode.parentNode != commonParent )
     203                                        currentNode = currentNode.parentNode ;
     204
     205                                var prevNode = ( endOffset >= endContainer.length ? currentNode : currentNode.previousSibling ) ;
     206
     207                                if ( prevNode && prevNode.nodeName.IEquals( 'br' ) )
     208                                        brNode = prevNode ;
     209                        }
     210
     211                        if ( brNode )
     212                        {
     213                                oRange.SetStart( brNode, 3 ) ;
     214                                oRange.SetEnd( brNode, 3 ) ;
     215                                var bookmark = oRange.CreateBookmark() ;
     216                                FCKDomTools.RemoveNode( brNode ) ;
     217                                oRange.MoveToBookmark( bookmark ) ;
     218                                oRange.Select() ;
     219                                return true ;
     220                        }
     221                })() ;
     222
     223                if ( returnNow )
     224                        return true ;
     225        }
     226
    171227        var oStartBlock = oRange.StartBlock ;
    172228        var oEndBlock = oRange.EndBlock ;
    173229
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy