Changeset 1044 for trunk/modules/WebKit


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/WebKit/WebKit.js

    r1001 r1044  
    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(); 
     
    593593  { 
    594594    range.selectNodeContents(node); 
    595     //(collapsed) && range.collapse(pos); 
    596595  } 
    597596  sel.removeAllRanges(); 
    598597  sel.addRange(range); 
     598  if (typeof collapseToStart != "undefined") 
     599  { 
     600    if (collapseToStart) 
     601    { 
     602      sel.collapse(range.startContainer, range.startOffset); 
     603    } else 
     604    { 
     605      sel.collapse(range.endContainer, range.endOffset); 
     606    } 
     607  } 
    599608}; 
    600609   
     
    685694Xinha.prototype.isKeyEvent = function(event) 
    686695{ 
    687   return event.type == "keypress"; 
     696  return event.type == "keydown"; 
    688697} 
    689698 
Note: See TracChangeset for help on using the changeset viewer.