Changeset 1044 for trunk/modules/Opera


Ignore:
Timestamp:
10/02/08 17:07:26 (11 years ago)
Author:
douglas
Message:

FIXED Ticket #1176 Merging new dialogs branch back to trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/Opera/Opera.js

    r1001 r1044  
    576576 * 
    577577 * @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  
     581Xinha.prototype.selectNodeContents = function(node, collapseToStart) 
    582582{ 
    583583  this.focusEditor(); 
    584584  this.forceRedraw(); 
    585585  var range; 
    586   var collapsed = typeof pos == "undefined" ? true : false; 
     586  var collapsed = typeof collapseToStart == "undefined" ? true : false; 
    587587  var sel = this.getSelection(); 
    588588  range = this._doc.createRange(); 
     
    595595  { 
    596596    range.selectNodeContents(node); 
    597     //(collapsed) && range.collapse(pos); 
    598597  } 
    599598  sel.removeAllRanges(); 
    600599  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  } 
    601610}; 
    602611   
Note: See TracChangeset for help on using the changeset viewer.