Ticket #6004: 6004.patch
File 6004.patch, 2.3 KB (added by , 14 years ago) |
---|
-
_source/core/dom/range.js
397 397 var startNode, endNode; 398 398 var baseId; 399 399 var clone; 400 var collapsed = this.collapsed; 400 401 401 402 startNode = this.document.createElement( 'span' ); 402 403 startNode.setAttribute( '_fck_bookmark', 1 ); … … 413 414 } 414 415 415 416 // If collapsed, the endNode will not be created. 416 if ( ! this.collapsed )417 if ( !collapsed ) 417 418 { 418 419 endNode = startNode.clone(); 419 420 endNode.setHtml( ' ' ); … … 442 443 return { 443 444 startNode : serializable ? baseId + 'S' : startNode, 444 445 endNode : serializable ? baseId + 'E' : endNode, 445 serializable : serializable 446 serializable : serializable, 447 collapsed : collapsed 446 448 }; 447 449 }, 448 450 … … 465 467 var startOffset = this.startOffset, 466 468 endOffset = this.endOffset; 467 469 470 var collapsed = this.collapsed; 471 468 472 var child, previous; 469 473 470 474 // If there is no range then get out of here. … … 501 505 } 502 506 503 507 // Process the end only if not normalized. 504 if ( ! this.isCollapsed )508 if ( !collapsed ) 505 509 { 506 510 // Find out if the start is pointing to a text node that 507 511 // will be normalized. … … 532 536 533 537 return { 534 538 start : startContainer.getAddress( normalized ), 535 end : this.isCollapsed ? null : endContainer.getAddress( normalized ),539 end : collapsed ? null : endContainer.getAddress( normalized ), 536 540 startOffset : startOffset, 537 541 endOffset : endOffset, 538 542 normalized : normalized, 543 collapsed : collapsed, 539 544 is2 : true // It's a createBookmark2 bookmark. 540 545 }; 541 546 }, -
_source/plugins/styles/plugin.js
1282 1282 while ( ( range = iterator.getNextRange() ) ) 1283 1283 func.call( this, range ); 1284 1284 1285 selection.selectBookmarks( bookmarks ); 1285 if ( bookmarks.length == 1 && bookmarks[0].collapsed ) 1286 selection.selectRanges( ranges ); 1287 else 1288 selection.selectBookmarks( bookmarks ); 1286 1289 } 1287 1290 })(); 1288 1291