Changeset 629

Show
Ignore:
Timestamp:
2007-08-07 06:58:14 (3 years ago)
Author:
martinkou
Message:

Fixed #1026 : Fixed the issue where the undo system is unable to restore cursor position when the cursor is placed inside or after empty block elements.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/editor/_source/internals/fckundo.js

    r617 r629  
    1818 * 
    1919 * == END LICENSE == 
    20  * 
    21  * Gecko specific implementation for the Undo/Redo system. 
    2220 */ 
    2321 
     
    3533        var range = new FCKDomRange( FCK.EditorWindow ) ; 
    3634        range.MoveToSelection() ; 
     35        if ( FCKBrowserInfo.IsIE ) 
     36        { 
     37                var bookmark = range.CreateBookmark() ; 
     38                var dirtyHtml = FCK.EditorDocument.body.innerHTML ; 
     39                range.MoveToBookmark( bookmark ) ; 
     40                return [ bookmark, dirtyHtml ] ; 
     41        } 
    3742        return range.CreateBookmark2() ; 
    3843} 
     
    4247        if ( ! bookmark ) 
    4348                return ; 
     49 
    4450        var range = new FCKDomRange( FCK.EditorWindow ) ; 
    4551        if ( bookmark instanceof Object ) 
    4652        { 
    47                 range.MoveToBookmark2( bookmark ) ; 
     53                if ( FCKBrowserInfo.IsIE ) 
     54                        range.MoveToBookmark( bookmark[0] ) ; 
     55                else 
     56                        range.MoveToBookmark2( bookmark ) ; 
    4857                try 
    4958                { 
     
    148157        // Update the editor contents with that step data. 
    149158        if ( FCKBrowserInfo.IsIE ) 
    150                 FCK.SetInnerHtml( oData[0] ) ; 
     159                FCK.SetInnerHtml( oData[1][1] ) ; 
    151160        else 
    152161                FCK.EditorDocument.body.innerHTML = oData[0] ;