Ticket #2057: 2057.patch

File 2057.patch, 1.0 kB (added by martinkou, 5 months ago)
  • editor/_source/internals/fckselection_ie.js

     
    239239        this.SelectionData = range ; 
    240240} 
    241241 
     242FCKSelection._GetSelectionDocument = function( selection ) 
     243{ 
     244        var range = selection.createRange() ; 
     245        if ( !range ) 
     246                return null; 
     247        else if ( range.item ) 
     248                return FCKTools.GetElementDocument( range.item( 0 ) ) ; 
     249        else 
     250                return FCKTools.GetElementDocument( range.parentElement() ) ; 
     251} 
     252 
    242253FCKSelection.Restore = function() 
    243254{ 
    244255        if ( this.SelectionData ) 
     
    247258 
    248259                try 
    249260                { 
     261                        // Don't repeat the restore process if the editor document is already selected. 
     262                        if ( this._GetSelectionDocument( FCK.EditorDocument.selection ) == FCK.EditorDocument ) 
     263                                return ; 
    250264                        this.SelectionData.select() ; 
    251265                } 
    252266                catch ( e ) {}