Ticket #1647: 1647.patch

File 1647.patch, 1.7 KB (added by Martin Kou, 11 years ago)
  • _whatsnew.html

     
    5858                        mode.</li>
    5959                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1934">#1934</a>] Fixed
    6060                        JavaScript errors when calling Selection.EnsureSelection() in dialogs.</li>
     61                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1647">#1647</a>] Pressing                 
     62                        Enter inside formatted text in list items will now split the list item as well.
     63                        </li>
    6164        </ul>
    6265        <h3>
    6366                Version 2.6 Beta 1</h3>
  • editor/_source/classes/fckenterkey.js

     
    400400
    401401        var oSplitInfo = oRange.SplitBlock() ;
    402402
    403         // FCKDebug.OutputObject( oSplitInfo ) ;
     403        // If there is one block under a list item, modify the split so that the list item gets split as well. (Bug #1647)
     404        if ( oSplitInfo.NextBlock )
     405        {
     406                if ( oSplitInfo.NextBlock.parentNode.nodeName.IEquals( 'li' ) )
     407                {
     408                        var eCurrentItem = oSplitInfo.NextBlock.parentNode ;
     409                        var eNextItem = FCKDomTools.InsertAfterNode( eCurrentItem, FCKDomTools.CloneElement( eCurrentItem ) ) ;
     410                        FCKDomTools.MoveNode( oSplitInfo.NextBlock, eNextItem ) ;
     411                }
     412        }
     413        else if ( oSplitInfo.PreviousBlock && oSplitInfo.PreviousBlock.parentNode.nodeName.IEquals( 'li' ) )
     414        {
     415                var eCurrentItem = oSplitInfo.PreviousBlock.parentNode ;
     416                var eNextItem = FCKDomTools.InsertAfterNode( eCurrentItem, FCKDomTools.CloneElement( eCurrentItem ) ) ;
     417                oRange.MoveToElementEditStart( eNextItem ) ;
     418        }
    404419
    405420        if ( oSplitInfo )
    406421        {
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy