Changeset 622
- Timestamp:
- 2007-08-03 12:52:47 (18 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
FCKeditor/trunk/editor/_source/classes/fckdomrange_ie.js
r618 r622 135 135 FCKDomRange.prototype._GetSelectionMarkerTag = function( toStart ) 136 136 { 137 var doc = this.Window.document 138 var selection = doc.selection ; 139 137 140 // Get a range for the start boundary. 138 var oRange = this.Window.document.selection.createRange() ; 141 var oRange ; 142 143 // IE may throw an "unspecified error" on some cases (it happened when 144 // loading _samples/default.html), so try/catch. 145 try 146 { 147 oRange = selection.createRange() ; 148 } 149 catch (e) 150 { 151 return null ; 152 } 153 139 154 oRange.collapse( toStart === true ) ; 140 155 … … 142 157 // This is known to happen when the editor window has not been selected before (See #933). 143 158 // We need to avoid that. 144 if ( oRange.parentElement().document != this.Window.document)159 if ( oRange.parentElement().document != doc ) 145 160 return null; 146 161 … … 148 163 var sMarkerId = 'fck_dom_range_temp_' + (new Date()).valueOf() + '_' + Math.floor(Math.random()*1000) ; 149 164 oRange.pasteHTML( '<span id="' + sMarkerId + '"></span>' ) ; 150 return this.Window.document.getElementById( sMarkerId ) ;165 return doc.getElementById( sMarkerId ) ; 151 166 } 152 167