Ticket #2323: 2323.patch

File 2323.patch, 2.0 KB (added by Martin Kou, 16 years ago)
  • _whatsnew.html

     
    5454                        has pressed the Source button.</li>
    5555                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2314">#2314</a>] Corrected
    5656                        mixed up Chinese translations for the blockquote command.</li>
     57                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2323">#2323</a>] Fixed the issue
     58                        where the show blocks command loses the current selection from the view area when editing
     59                        a long document.</li>
    5760        </ul>
    5861        <p>
    5962                <a href="_whatsnew_history.html">See previous versions history</a></p>
  • editor/_source/commandclasses/fckshowblocks.js

     
    4444        else
    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}
    4966
  • editor/_source/internals/fckdomtools.js

     
    10041004
    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        },
    10101010
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy