Changeset 862
- Timestamp:
- 09/22/07 00:33:54 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
FCKeditor/trunk/editor/_source/classes/fckdomrange.js
r838 r862 253 253 // handle DOM mutations when moving back to the bookmark. 254 254 // Attention: the inclusion of nodes in the DOM is a design choice and 255 // should not be change sas there are other points in the code that may be255 // should not be changed as there are other points in the code that may be 256 256 // using those nodes to perform operations. See GetBookmarkNode. 257 257 // For performance, includeNodes=true if intended to SelectBookmark. … … 266 266 267 267 var oDoc = this.Window.document ; 268 var eSpan ; 268 var eStartSpan ; 269 var eEndSpan ; 269 270 var oClone ; 270 271 … … 272 273 if ( !this.CheckIsCollapsed() ) 273 274 { 274 e Span = oDoc.createElement( 'span' ) ;275 e Span.id = oBookmark.EndId ;276 e Span.setAttribute( '_fck_bookmark', true ) ;275 eEndSpan = oDoc.createElement( 'span' ) ; 276 eEndSpan.id = oBookmark.EndId ; 277 eEndSpan.setAttribute( '_fck_bookmark', true ) ; 277 278 278 279 // For IE, it must have something inside, otherwise it may be 279 280 // removed during DOM operations. 280 281 // if ( FCKBrowserInfo.IsIE ) 281 e Span.innerHTML = ' ' ;282 eEndSpan.innerHTML = ' ' ; 282 283 283 284 oClone = this.Clone() ; 284 285 oClone.Collapse( false ) ; 285 oClone.InsertNode( eSpan ) ; 286 287 if ( includeNodes ) 288 oBookmark.EndNode = eSpan ; 289 } 290 291 eSpan = oDoc.createElement( 'span' ) ; 292 eSpan.id = oBookmark.StartId ; 293 eSpan.setAttribute( '_fck_bookmark', true ) ; 286 oClone.InsertNode( eEndSpan ) ; 287 } 288 289 eStartSpan = oDoc.createElement( 'span' ) ; 290 eStartSpan.id = oBookmark.StartId ; 291 eStartSpan.setAttribute( '_fck_bookmark', true ) ; 294 292 295 293 // For IE, it must have something inside, otherwise it may be removed 296 294 // during DOM operations. 297 295 // if ( FCKBrowserInfo.IsIE ) 298 eS pan.innerHTML = ' ' ;296 eStartSpan.innerHTML = ' ' ; 299 297 300 298 oClone = this.Clone() ; 301 299 oClone.Collapse( true ) ; 302 oClone.InsertNode( eS pan ) ;300 oClone.InsertNode( eStartSpan ) ; 303 301 304 302 if ( includeNodes ) 305 oBookmark.StartNode = eSpan ; 306 303 { 304 oBookmark.StartNode = eStartSpan ; 305 oBookmark.EndNode = eEndSpan ; 306 } 307 308 // Update the range position. 309 if ( eEndSpan ) 310 { 311 this.SetStart( eStartSpan, 4 ) ; 312 this.SetEnd( eEndSpan, 3 ) ; 313 } 314 else 315 this.MoveToPosition( eStartSpan, 4 ) ; 316 307 317 return oBookmark ; 308 318 },
Note: See TracChangeset
for help on using the changeset viewer.
