Implement MouseEvent#delta for Item#onMouseDrag and #onMouseMove.

This commit is contained in:
Jürg Lehni 2011-11-17 00:04:30 +01:00
parent cf54b1a7c1
commit 1b484a2f7b
2 changed files with 38 additions and 14 deletions

View file

@ -20,11 +20,12 @@
* @extends Event
*/
var MouseEvent = this.MouseEvent = Event.extend(/** @lends MouseEvent# */{
initialize: function(type, event, point, target) {
initialize: function(type, event, point, target, delta) {
this.base(event);
this.type = type;
this.point = point;
this.target = target;
this.delta = delta;
},
/**
@ -34,6 +35,7 @@ var MouseEvent = this.MouseEvent = Event.extend(/** @lends MouseEvent# */{
return '{ type: ' + this.type
+ ', point: ' + this.point
+ ', target: ' + this.target
+ (this.delta ? ', delta: ' + this.delta : '')
+ ', modifiers: ' + this.getModifiers()
+ ' }';
}