Simplified the ISequence interface and sequence event handling.

This commit is contained in:
ahocevar
2012-06-22 14:13:09 +02:00
parent 07021d367b
commit 494305d725
4 changed files with 78 additions and 93 deletions
+9 -7
View File
@@ -12,13 +12,19 @@ goog.require('goog.functions');
/**
* @constructor
* @param {Element} target The element that will be dragged.
* @param {ol.event.Events} target The Events instance that handles events.
* @extends {goog.fx.Dragger}
* @implements {ol.event.ISequence}
* @export
*/
ol.event.Drag = function(target) {
goog.base(this, target);
goog.base(this, target.getElement());
/**
* @private
* @type {ol.event.Events}
*/
this.target_ = target;
/**
* @private
@@ -47,6 +53,7 @@ ol.event.Drag.prototype.dispatchEvent = function(e) {
e.type = ol.event.Drag.EventType.DRAGEND;
}
}
this.target_.dispatchEvent(/** @type {Event} */ (e));
return goog.base(this, 'dispatchEvent', e);
};
@@ -67,11 +74,6 @@ ol.event.Drag.prototype.doDrag = function(e, x, y, dragFromScroll) {
/** @override */
ol.event.Drag.prototype.defaultAction = function(x, y) {};
/** @inheritDoc */
ol.event.Drag.prototype.getEventTypes = function() {
return ol.event.Drag.EventType;
};
/** @inheritDoc */
ol.event.Drag.prototype.destroy = ol.event.Drag.prototype.dispose;