Reputation: 167
I created a dojo graphic group and hooked couple of mouse events to it, but the mouseclick event fire all other mouse events, I haven't moved the mouse while clicking.
A mouse click fired both 'mouseout', 'mouseenter' and finally 'mousedown'.
Anyone has any ideas?
var group = surface.createGroup();
group.on("mousedown", function(e) { handle mouse click here });
group.on("mouseout", function(e) { handle mouse out here });
group.on("mouseenter", function(e) { handle mouse enter here });
UPDATE: I was recreating the graphic on the mouse enter and that caused all sorts of problems.
Upvotes: 0
Views: 873
Reputation: 3568
Try using dojo/mouse
(http://livedocs.dojotoolkit.org/dojo/mouse) :
var group = surface.createGroup();
group.on("mousedown", function(e) { handle mouse click here });
group.on(mouse.leave, function(e) { handle mouse out here });
group.on(mouse.enter, function(e) { handle mouse enter here });
I guess click
should be better than mousedown
as you wrote "handle mouse click here"
Upvotes: 0