Changeset 2144

Show
Ignore:
Timestamp:
2008-06-26 11:42:50 (21 months ago)
Author:
martinkou
Message:

Fixed #2323 : Fixed the issue where the show blocks command loses the current selection from the view area when editing a long document.

Location:
FCKeditor/trunk
Files:
3 modified

Legend:

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

    r1565 r2144  
    4545                body.className += ' FCK__ShowBlocks' ; 
    4646 
     47        if ( FCKBrowserInfo.IsIE ) 
     48        { 
     49                try 
     50                { 
     51                        FCK.EditorDocument.selection.createRange().select() ; 
     52                } 
     53                catch ( e ) 
     54                {} 
     55        } 
     56        else 
     57        { 
     58                var focus = FCK.EditorWindow.getSelection().focusNode ; 
     59                if ( focus.nodeType != 1 ) 
     60                        focus = focus.parentNode ; 
     61                FCKDomTools.ScrollIntoView( focus, false ) ; 
     62        } 
     63 
    4764        FCK.Events.FireEvent( 'OnSelectionChange' ) ; 
    4865} 
  • FCKeditor/trunk/editor/_source/internals/fckdomtools.js

    r2096 r2144  
    10051005                // Scroll the window to the desired position, if not already visible. 
    10061006                var currentScroll = FCKTools.GetScrollPosition( window ).Y ; 
    1007                 if ( offset > 0 && offset > currentScroll ) 
     1007                if ( offset > 0 && ( offset > currentScroll || offset < currentScroll - windowHeight ) ) 
    10081008                        window.scrollTo( 0, offset ) ; 
    10091009        }, 
  • FCKeditor/trunk/_whatsnew.html

    r2143 r2144  
    5959                        3, the entire page was scrolling when inserting block elements with the FCK.InsertElement 
    6060                        function, used by the Table and Horizontal Rule buttons.. </li> 
     61                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2323">#2323</a>] Fixed the issue 
     62                        where the show blocks command loses the current selection from the view area when editing 
     63                        a long document.</li> 
    6164        </ul> 
    6265        <p>