Ticket #1647: 1647_2.patch

File 1647_2.patch, 2.0 kB (added by martinkou, 7 months ago)
  • _whatsnew.html

     
    6565                        [<a target="_blank" href="http://dev.fckeditor.net/ticket/1985">#1985</a>]  
    6666                        [<a target="_blank" href="http://dev.fckeditor.net/ticket/1989">#1989</a>]  
    6767                        Fixed XHTML source formatting errors in non-IE browsers.</li> 
     68                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1647">#1647</a>] Pressing                  
     69                        Enter inside formatted text in list items will now split the list item as well. 
     70                        </li> 
    6871        </ul> 
    6972        <h3> 
    7073                Version 2.6 Beta 1</h3> 
  • editor/_source/classes/fckenterkey.js

     
    400400 
    401401        var oSplitInfo = oRange.SplitBlock() ; 
    402402 
    403         // FCKDebug.OutputObject( oSplitInfo ) ; 
    404  
    405403        if ( oSplitInfo ) 
    406404        { 
    407405                // Get the current blocks. 
     
    411409                var bIsStartOfBlock     = oSplitInfo.WasStartOfBlock ; 
    412410                var bIsEndOfBlock       = oSplitInfo.WasEndOfBlock ; 
    413411 
     412                // If there is one block under a list item, modify the split so that the list item gets split as well. (Bug #1647) 
     413                if ( eNextBlock ) 
     414                { 
     415                        if ( eNextBlock.parentNode.nodeName.IEquals( 'li' ) ) 
     416                        { 
     417                                FCKDomTools.BreakParent( eNextBlock, eNextBlock.parentNode ) ; 
     418                                FCKDomTools.MoveNode( eNextBlock, eNextBlock.nextSibling, true ) ; 
     419                        } 
     420                } 
     421                else if ( ePreviousBlock && ePreviousBlock.parentNode.nodeName.IEquals( 'li' ) ) 
     422                { 
     423                        FCKDomTools.BreakParent( ePreviousBlock, ePreviousBlock.parentNode ) ; 
     424                        var eNewItem = ePreviousBlock.nextSibling ; 
     425                        FCKDomTools.MoveNode( ePreviousBlock, ePreviousBlock.previousSibling ) ; 
     426                        oRange.MoveToElementEditStart( eNewItem ) ; 
     427                } 
     428 
    414429                // If we have both the previous and next blocks, it means that the 
    415430                // boundaries were on separated blocks, or none of them where on the 
    416431                // block limits (start/end).