Index: FCKeditor/trunk/_whatsnew.html
===================================================================
--- FCKeditor/trunk/_whatsnew.html (revision 1774)
+++ FCKeditor/trunk/_whatsnew.html (revision 1775)
@@ -113,4 +113,7 @@
[#1998] The native
XMLHttpRequest class is now used in IE, whenever it is available.
+ [#1792] In IE,
+ the browser was able to enter in an infinite loop when working with multiple editors
+ in the same page.
Index: FCKeditor/trunk/editor/_source/classes/fckeditingarea.js
===================================================================
--- FCKeditor/trunk/editor/_source/classes/fckeditingarea.js (revision 1774)
+++ FCKeditor/trunk/editor/_source/classes/fckeditingarea.js (revision 1775)
@@ -301,14 +301,8 @@
if ( this.Mode == FCK_EDITMODE_WYSIWYG )
{
- // The following check is important to avoid IE entering in a focus loop. Ref:
- // http://sourceforge.net/tracker/index.php?func=detail&aid=1567060&group_id=75348&atid=543653
- if ( FCKBrowserInfo.IsIE && this.Document.hasFocus() )
- this._EnsureFocusIE() ;
-
- this.Window.focus() ;
-
- // In IE it can happen that the document is in theory focused but the active element is outside it
if ( FCKBrowserInfo.IsIE )
- this._EnsureFocusIE() ;
+ this._FocusIE() ;
+ else
+ this.Window.focus() ;
}
else
@@ -324,8 +318,11 @@
}
-FCKEditingArea.prototype._EnsureFocusIE = function()
-{
- // In IE it can happen that the document is in theory focused but the active element is outside it
+FCKEditingArea.prototype._FocusIE = function()
+{
+ // In IE it can happen that the document is in theory focused but the
+ // active element is outside of it.
this.Document.body.setActive() ;
+
+ this.Window.focus() ;
// Kludge for #141... yet more code to workaround IE bugs
Index: FCKeditor/trunk/editor/_source/internals/fck.js
===================================================================
--- FCKeditor/trunk/editor/_source/internals/fck.js (revision 1774)
+++ FCKeditor/trunk/editor/_source/internals/fck.js (revision 1775)
@@ -1146,6 +1146,20 @@
function FCKFocusManager_Win_OnFocus_Area()
{
+ // Check if we are already focusing the editor (to avoid loops).
+ if ( FCKFocusManager._IsFocusing )
+ return ;
+
+ FCKFocusManager._IsFocusing = true ;
+
FCK.Focus() ;
FCKFocusManager_Win_OnFocus() ;
+
+ // The above FCK.Focus() call may trigger other focus related functions.
+ // So, to avoid a loop, we delay the focusing mark removal, so it get
+ // executed after all othre functions have been run.
+ FCKTools.RunFunction( function()
+ {
+ delete FCKFocusManager._IsFocusing ;
+ } ) ;
}