rem:  var toIdx = this._find(toItem); var step = fromIdx < toIdx ? -1 : 1; var shrink = lastIdx >= 0 && step == 1 ? lastIdx < toIdx : lastIdx > toIdx; var range = dojo.math.range(toIdx, fromIdx, step); if(range.length) { for(var i = range.length-1; i >= 0; i--) { var item = this.items[range[i]]; if(this.selectFilter(item, this.selection, false, true)) { if(this.select(item, true) || shrink) { this.lastSelected = item; } if(range[i] in toDeselect) { delete toDeselect[range[i]]; 
add:  var toIdx = this._find(toItem); var step = fromIdx < toIdx ? -1 : 1; var shrink = lastIdx >= 0 && step == 1 ? lastIdx < toIdx : lastIdx > toIdx; var range = dojo.math.range(toIdx, fromIdx, step); if(range.length){ for(var i = range.length-1; i >= 0; i--){ var item = this.items[range[i]]; if(this.selectFilter(item, this.selection, false, true)){ if(this.select(item, true) || shrink){ this.lastSelected = item; } if(range[i] in toDeselect){ delete toDeselect[range[i]]; } 
context: 	grow: function(toItem, fromItem) {		if(!this.isGrowable) { return; }		if(arguments.length == 1) {			fromItem = this._pivotItem;			if(!fromItem && this.allowImplicit) {				fromItem = this.items[0];			}		}		if(!toItem || !fromItem) { return false; }		var fromIdx = this._find(fromItem);		// get items to deselect (fromItem, lastSelected]		var toDeselect = {};		var lastIdx = -1;		if(this.lastSelected) {			lastIdx = this._find(this.lastSelected);			var step = fromIdx < lastIdx ? -1 : 1;			var range = dojo.math.range(lastIdx, fromIdx, step);			for(var i = 0; i < range.length; i++) {				toDeselect[range[i]] = true;			}		}		// add selection (fromItem, toItem]		var toIdx = this._find(toItem);		var step = fromIdx < toIdx ? -1 : 1;		var shrink = lastIdx >= 0 && step == 1 ? lastIdx < toIdx : lastIdx > toIdx;		var range = dojo.math.range(toIdx, fromIdx, step);		if(range.length) {			for(var i = range.length-1; i >= 0; i--) {				var item = this.items[range[i]];				if(this.selectFilter(item, this.selection, false, true)) {					if(this.select(item, true) || shrink) {						this.lastSelected = item;					}					if(range[i] in toDeselect) {						delete toDeselect[range[i]];					}				}			}		} else {			this.lastSelected = fromItem;		}		// now deselect...		for(var i in toDeselect) {			if(this.items[i] == this.lastSelected) {				//dojo.debug("oops!");			}			this.deselect(this.items[i]);		}		// make sure everything is all kosher after selections+deselections		this._updatePivot();	},
meta: 4707	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4707/50c3492c4c3c825dbd3401e134a19ed46799c456/Selection.js/clean/www/resources/dojo-ajax/src/selection/Selection.js