source: [view]
this.events = [
dojo.connect(dojo.doc, "onmousedown", this, "_onMouseDown"),
dojo.connect(dojo.doc, "onmouseup", this, "_onMouseUp"),
// cancel text selection and text dragging
//dojo.connect(dojo.doc, "ondragstart", dojo.stopEvent),
//dojo.connect(dojo.doc, "onselectstart", dojo.stopEvent),
// when a user is scrolling using a scrollbar, don't draw the bounding box.
dojo.connect(dojo.doc, "onscroll", this, "_finishSelecting")
];
// set up a subscription so the client can easily cancel a user drawing a bounding box.
this.subscriptions = [
dojo.subscribe("/dojox/bounding/cancel", this, "_finishSelecting")
];
dojo.forEach(sources, function(item){
// listen for "/dojox/dnd/bounding" events eminating from the bounding box.
// for each of the dojox.dnd.selectors passed in args.
if(item.selectByBBox){
this.subscriptions.push(dojo.subscribe("/dojox/dnd/bounding", item, "selectByBBox"));
}
}, this)
this.domNode = dojo.byId(domNode);
dojo.style(this.domNode, {
position: "absolute",
display: "none"
});