Skip to content

Commit

Permalink
Use more robust up/down traversal method from Grid to do selection
Browse files Browse the repository at this point in the history
  • Loading branch information
kriszyp committed Jul 21, 2011
1 parent 905ea88 commit 87fe012
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions Selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,10 @@ return declare([List], {
// find if it is earlier or later in the DOM
var traverser = (toElement && (toElement.compareDocumentPosition ?
toElement.compareDocumentPosition(fromElement) == 2 :
toElement.sourceIndex > fromElement.sourceIndex)) ? "nextSibling" : "previousSibling";
var nextNode;
while(nextNode = row.element[traverser]){
// loop through and set everything
row = this.row(nextNode);
toElement.sourceIndex > fromElement.sourceIndex)) ? "down" : "up";
while(row = this[traverser](row)){
this.select(row);
if(nextNode == toElement){
if(row.element == toElement){
break;
}
}
Expand Down

0 comments on commit 87fe012

Please sign in to comment.