Ticket #1792: 1792.patch

File 1792.patch, 2.9 KB (added by fredck, 2 years ago)
  • _whatsnew.html

     
    107107                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1832">#1832</a>] Calling 
    108108                        FCK.InsertHtml() in non-IE browsers would now activate the document processor 
    109109                        as expected.</li> 
     110                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1792">#1792</a>] In IE, 
     111                        the browser was able to enter in an infinite loop when working with multiple editors 
     112                        in the same page. </li> 
    110113        </ul> 
    111114        <h3> 
    112115                Version 2.6 Beta 1</h3> 
  • editor/_source/classes/fckeditingarea.js

     
    300300        { 
    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 
    315309                { 
     
    323317        catch(e) {} 
    324318} 
    325319 
    326 FCKEditingArea.prototype._EnsureFocusIE = function() 
     320FCKEditingArea.prototype._FocusIE = function() 
    327321{ 
    328         // In IE it can happen that the document is in theory focused but the active element is outside it 
     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() ; 
    330325 
     326        this.Window.focus() ; 
     327 
    331328        // Kludge for #141... yet more code to workaround IE bugs 
    332329        var range = this.Document.selection.createRange() ; 
    333330 
  • editor/_source/internals/fck.js

     
    11451145 
    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 
    11521166function FCKFocusManager_Win_OnFocus()