Changeset 1119

Show
Ignore:
Timestamp:
2007-11-26 09:10:41 (2 years ago)
Author:
martinkou
Message:

Fixed #1562 : Fixed the issue where empty paragraphs are added around page breaks when switching to Source mode.
Fixed the issue where page breaks are added inside paragraph blocks.

Location:
FCKeditor/trunk/editor/_source
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/editor/_source/commandclasses/fck_othercommands.js

    r934 r1119  
    250250 
    251251        var oFakeImage = FCKDocumentProcessor_CreateFakeImage( 'FCK__PageBreak', e ) ; 
    252         FCK.InsertElement( oFakeImage ) ; 
     252        var oRange = new FCKDomRange( FCK.EditorWindow ) ; 
     253        oRange.MoveToSelection() ; 
     254        var oSplitInfo = oRange.SplitBlock() ; 
     255        if ( oSplitInfo.NextBlock ) 
     256                oSplitInfo.NextBlock.parentNode.insertBefore( oFakeImage, oSplitInfo.NextBlock ) ; 
     257        else 
     258                oSplitInfo.PreviousBlock.parentNode.insertBefore( oFakeImage, oSplitInfo.PreviousBlock.nextSibling ) ; 
     259 
     260        FCK.Events.FireEvent( 'OnSelectionChange' ) ; 
    253261} 
    254262 
  • FCKeditor/trunk/editor/_source/internals/fck.js

    r1067 r1119  
    177177                                // Element Node. 
    178178                                case 1 : 
    179                                         if ( !FCKListsLib.BlockElements[ oNode.nodeName.toLowerCase() ] ) 
     179                                        if ( !FCKListsLib.BlockElements[ oNode.nodeName.toLowerCase() ] &&  
     180                                                        !oNode.getAttribute('_fckfakelement') ) 
    180181                                                bMoveNode = true ; 
    181182                                        break ;