Replace goog.events.Event/EventTarget system with our own

This also removes goog.events.listen, goog.events.unlisten,
goog.events.unlistenByKey and goog.events.BrowserEvent.
This commit is contained in:
Andreas Hocevar
2016-01-29 16:29:46 +01:00
parent d87482e415
commit 3f2d79b7fe
110 changed files with 1143 additions and 733 deletions
+51
View File
@@ -0,0 +1,51 @@
goog.provide('ol.events.Event');
/**
* @constructor
* @param {ol.events.EventType|string} type Type.
* @param {Object=} opt_target Target.
*/
ol.events.Event = function(type, opt_target) {
/**
* @type {boolean}
*/
this.propagationStopped;
/**
* @type {string}
*/
this.type = type;
/**
* @type {Object|undefined}
*/
this.target = opt_target;
};
/**
* Stop event propagation
*/
ol.events.Event.prototype.preventDefault =
ol.events.Event.prototype.stopPropagation = function() {
this.propagationStopped = true;
};
/**
* @param {Event|ol.events.Event} evt Event
*/
ol.events.Event.stopPropagation = function(evt) {
evt.stopPropagation();
};
/**
* @param {Event|ol.events.Event} evt Event
*/
ol.events.Event.preventDefault = function(evt) {
evt.preventDefault();
};