Index: _whatsnew.html
===================================================================
--- _whatsnew.html (revision 2141)
+++ _whatsnew.html (working copy)
@@ -54,6 +54,9 @@
has pressed the Source button.
[#2314] Corrected
mixed up Chinese translations for the blockquote command.
+ [#2322] Fixed the issue
+ where the fit window command loses the current selection and scroll position in the
+ editing area.
See previous versions history
Index: editor/_source/commandclasses/fckfitwindow.js
===================================================================
--- editor/_source/commandclasses/fckfitwindow.js (revision 2141)
+++ editor/_source/commandclasses/fckfitwindow.js (working copy)
@@ -37,6 +37,11 @@
var eBodyStyle = eBody.style ;
var eParent ;
+ // Save the current selection and scroll position.
+ var oRange = new FCKDomRange( FCK.EditorWindow ) ;
+ oRange.MoveToSelection() ;
+ var oEditorScrollPos = FCKTools.GetScrollPosition( FCK.EditorWindow ) ;
+
// No original style properties known? Go fullscreen.
if ( !this.IsMaximized )
{
@@ -160,6 +165,10 @@
FCK.EditingArea.MakeEditable() ;
FCK.Focus() ;
+
+ // Restore the selection and scroll position of inside the document.
+ oRange.Select() ;
+ FCK.EditorWindow.scrollTo( oEditorScrollPos.X, oEditorScrollPos.Y ) ;
}
FCKFitWindow.prototype.GetState = function()