Show
Ignore:
Timestamp:
10/01/08 15:52:00 (4 years ago)
Author:
douglas
Message:

FIXED Ticket #1276 Update selectNodeContents to collapse in one direction or another, not to a specific location. Update docs to reflect this

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/new-dialogs/modules/WebKit/WebKit.js

    r1039 r1042  
    574574 * 
    575575 * @param node DomNode  
    576  * @param pos  Set to a numeric position inside the node to collapse the cursor here if possible.  
    577  */ 
    578   
    579 Xinha.prototype.selectNodeContents = function(node, pos) 
     576 * @param collapseToStart A boolean that, when supplied, says to collapse the selection. True collapses to the start, and false to the end. 
     577 */ 
     578  
     579Xinha.prototype.selectNodeContents = function(node, collapseToStart) 
    580580{ 
    581581  this.focusEditor(); 
    582582  this.forceRedraw(); 
    583583  var range; 
    584   var collapsed = typeof pos == "undefined" ? true : false; 
     584  var collapsed = typeof collapseToStart == "undefined" ? true : false; 
    585585  var sel = this.getSelection(); 
    586586  range = this._doc.createRange(); 
     
    596596  sel.removeAllRanges(); 
    597597  sel.addRange(range); 
    598   if (typeof pos != "undefined") 
    599   { 
    600     if (pos) 
     598  if (typeof collapseToStart != "undefined") 
     599  { 
     600    if (collapseToStart) 
    601601    { 
    602602      sel.collapse(range.startContainer, range.startOffset);