Ticket #2322: 2322.patch

File 2322.patch, 1.6 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/2322">#2322</a>] Fixed the issue
     58                        where the fit window command loses the current selection and scroll position in the
     59                        editing area.</li>
    5760        </ul>
    5861        <p>
    5962                <a href="_whatsnew_history.html">See previous versions history</a></p>
  • editor/_source/commandclasses/fckfitwindow.js

     
    3737        var eBodyStyle                  = eBody.style ;
    3838        var eParent ;
    3939
     40        // Save the current selection and scroll position.
     41        var oRange = new FCKDomRange( FCK.EditorWindow ) ;
     42        oRange.MoveToSelection() ;
     43        var oEditorScrollPos = FCKTools.GetScrollPosition( FCK.EditorWindow ) ;
     44
    4045        // No original style properties known? Go fullscreen.
    4146        if ( !this.IsMaximized )
    4247        {
     
    160165                FCK.EditingArea.MakeEditable() ;
    161166
    162167        FCK.Focus() ;
     168
     169        // Restore the selection and scroll position of inside the document.
     170        oRange.Select() ;
     171        FCK.EditorWindow.scrollTo( oEditorScrollPos.X, oEditorScrollPos.Y ) ;
    163172}
    164173
    165174FCKFitWindow.prototype.GetState = function()
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy