Index: _whatsnew.html
===================================================================
--- _whatsnew.html (revision 2563)
+++ _whatsnew.html (working copy)
@@ -77,6 +77,8 @@
condition at registering the FCKeditorAPI object in multiple editor scenarios.
[#2525] Fixed JavaScript
error in Google Chrome when StartupShowBlocks is set to true.
+ [#2531] The ENTER
+ key will properly scroll to the cursor position when breaking long paragraphs.
See previous versions history
Index: editor/_source/classes/fckenterkey.js
===================================================================
--- editor/_source/classes/fckenterkey.js (revision 2563)
+++ editor/_source/classes/fckenterkey.js (working copy)
@@ -536,8 +536,28 @@
}
if ( FCKBrowserInfo.IsGeckoLike )
- FCKDomTools.ScrollIntoView( eNextBlock || eNewBlock, false ) ;
-
+ {
+ if ( eNextBlock )
+ {
+ // If we have split the block, adds a temporary span at the
+ // range position and scroll relatively to it.
+ var tmpNode = this.Window.document.createElement( 'span' ) ;
+
+ // We need some content for Safari.
+ tmpNode.innerHTML = ' ';
+
+ oRange.InsertNode( tmpNode ) ;
+ FCKDomTools.ScrollIntoView( tmpNode, false ) ;
+ oRange.DeleteContents() ;
+ }
+ else
+ {
+ // We may use the above scroll logic for the new block case
+ // too, but it gives some weird result with Opera.
+ FCKDomTools.ScrollIntoView( eNextBlock || eNewBlock, false ) ;
+ }
+ }
+
oRange.Select() ;
}