Changeset 1042 for branches/new-dialogs/modules/Opera
- Timestamp:
- 10/01/08 15:52:00 (4 years ago)
- Files:
-
- 1 modified
-
branches/new-dialogs/modules/Opera/Opera.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/new-dialogs/modules/Opera/Opera.js
r1001 r1042 576 576 * 577 577 * @param node DomNode 578 * @param pos Set to a numeric position inside the node to collapse the cursor here if possible.579 */ 580 581 Xinha.prototype.selectNodeContents = function(node, pos)578 * @param collapseToStart A boolean that, when supplied, says to collapse the selection. True collapses to the start, and false to the end. 579 */ 580 581 Xinha.prototype.selectNodeContents = function(node, collapseToStart) 582 582 { 583 583 this.focusEditor(); 584 584 this.forceRedraw(); 585 585 var range; 586 var collapsed = typeof pos== "undefined" ? true : false;586 var collapsed = typeof collapseToStart == "undefined" ? true : false; 587 587 var sel = this.getSelection(); 588 588 range = this._doc.createRange(); … … 595 595 { 596 596 range.selectNodeContents(node); 597 //(collapsed) && range.collapse(pos);598 597 } 599 598 sel.removeAllRanges(); 600 599 sel.addRange(range); 600 if (typeof collapseToStart != "undefined") 601 { 602 if (collapseToStart) 603 { 604 sel.collapse(range.startContainer, range.startOffset); 605 } else 606 { 607 sel.collapse(range.endContainer, range.endOffset); 608 } 609 } 601 610 }; 602 611
