dojo.dnd.Selector.onMouseDown
dojo.require("dojo.dnd.Selector");
defined in dojo/dnd/Selector.js
event processor for onmousedown
Usage
function (e) (view source)
if(!this.current){ return; } if(!this.singular && !dojo.dnd.getCopyKeyState(e) && !e.shiftKey && (this.current.id in this.selection)){ this.simpleSelection = true; dojo.stopEvent(e); return; } if(!this.singular && e.shiftKey){ if(!dojo.dnd.getCopyKeyState(e)){ this._removeSelection(); } var c = this.getAllNodes(); if(c.length){ if(!this.anchor){ this.anchor = c[0]; this._addItemClass(this.anchor, "Anchor"); } this.selection[this.anchor.id] = 1; if(this.anchor != this.current){ var i = 0; for(; i < c.length; ++i){ var node = c[i]; if(node == this.anchor || node == this.current){ break; } } for(++i; i < c.length; ++i){ var node = c[i]; if(node == this.anchor || node == this.current){ break; } this._addItemClass(node, "Selected"); this.selection[node.id] = 1; } this._addItemClass(this.current, "Selected"); this.selection[this.current.id] = 1; } } }else{ if(this.singular){ if(this.anchor == this.current){ if(dojo.dnd.getCopyKeyState(e)){ this.selectNone(); } }else{ this.selectNone(); this.anchor = this.current; this._addItemClass(this.anchor, "Anchor"); this.selection[this.current.id] = 1; } }else{ if(dojo.dnd.getCopyKeyState(e)){ if(this.anchor == this.current){ delete this.selection[this.anchor.id]; this._removeAnchor(); }else{ if(this.current.id in this.selection){ this._removeItemClass(this.current, "Selected"); delete this.selection[this.current.id]; }else{ if(this.anchor){ this._removeItemClass(this.anchor, "Anchor"); this._addItemClass(this.anchor, "Selected"); } this.anchor = this.current; this._addItemClass(this.current, "Anchor"); this.selection[this.current.id] = 1; } } }else{ if(!(this.current.id in this.selection)){ this.selectNone(); this.anchor = this.current; this._addItemClass(this.current, "Anchor"); this.selection[this.current.id] = 1; } } } } dojo.stopEvent(e);
parameter | type | description |
---|---|---|
e | mouse event |