Changeset 1775 for FCKeditor/trunk


Ignore:
Timestamp:
03/22/2008 05:40:44 PM (7 years ago)
Author:
fredck
Message:

Fixed #1792 : In IE, the browser was able to enter in an infinite loop when working with multiple editors in the same page.

Location:
FCKeditor/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/_whatsnew.html

    r1773 r1775  
    113113                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1998">#1998</a>] The native
    114114                        XMLHttpRequest class is now used in IE, whenever it is available.</li>
     115                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1792">#1792</a>] In IE,
     116                        the browser was able to enter in an infinite loop when working with multiple editors
     117                        in the same page. </li>
    115118        </ul>
    116119        <h3>
  • FCKeditor/trunk/editor/_source/classes/fckeditingarea.js

    r1708 r1775  
    301301                if ( this.Mode == FCK_EDITMODE_WYSIWYG )
    302302                {
    303                         // The following check is important to avoid IE entering in a focus loop. Ref:
    304                         // http://sourceforge.net/tracker/index.php?func=detail&aid=1567060&group_id=75348&atid=543653
    305                         if ( FCKBrowserInfo.IsIE && this.Document.hasFocus() )
    306                                 this._EnsureFocusIE() ;
    307 
    308                         this.Window.focus() ;
    309 
    310                         // In IE it can happen that the document is in theory focused but the active element is outside it
    311303                        if ( FCKBrowserInfo.IsIE )
    312                                 this._EnsureFocusIE() ;
     304                                this._FocusIE() ;
     305                        else
     306                                this.Window.focus() ;
    313307                }
    314308                else
     
    324318}
    325319
    326 FCKEditingArea.prototype._EnsureFocusIE = function()
    327 {
    328         // In IE it can happen that the document is in theory focused but the active element is outside it
     320FCKEditingArea.prototype._FocusIE = function()
     321{
     322        // In IE it can happen that the document is in theory focused but the
     323        // active element is outside of it.
    329324        this.Document.body.setActive() ;
     325
     326        this.Window.focus() ;
    330327
    331328        // Kludge for #141... yet more code to workaround IE bugs
  • FCKeditor/trunk/editor/_source/internals/fck.js

    r1629 r1775  
    11461146function FCKFocusManager_Win_OnFocus_Area()
    11471147{
     1148        // Check if we are already focusing the editor (to avoid loops).
     1149        if ( FCKFocusManager._IsFocusing )
     1150                return ;
     1151
     1152        FCKFocusManager._IsFocusing = true ;
     1153
    11481154        FCK.Focus() ;
    11491155        FCKFocusManager_Win_OnFocus() ;
     1156
     1157        // The above FCK.Focus() call may trigger other focus related functions.
     1158        // So, to avoid a loop, we delay the focusing mark removal, so it get
     1159        // executed after all othre functions have been run.
     1160        FCKTools.RunFunction( function()
     1161                {
     1162                        delete FCKFocusManager._IsFocusing ;
     1163                } ) ;
    11501164}
    11511165
Note: See TracChangeset for help on using the changeset viewer.
© 2003 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy