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:
@@ -53,7 +53,7 @@ ol.pointer.MsSource = function(dispatcher) {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {!Object.<string, goog.events.BrowserEvent|Object>}
|
||||
* @type {!Object.<string, Event|Object>}
|
||||
*/
|
||||
this.pointerMap = dispatcher.pointerMap;
|
||||
|
||||
@@ -77,14 +77,14 @@ goog.inherits(ol.pointer.MsSource, ol.pointer.EventSource);
|
||||
* for the fake pointer event.
|
||||
*
|
||||
* @private
|
||||
* @param {goog.events.BrowserEvent} inEvent The in event.
|
||||
* @param {Event} inEvent The in event.
|
||||
* @return {Object} The copied event.
|
||||
*/
|
||||
ol.pointer.MsSource.prototype.prepareEvent_ = function(inEvent) {
|
||||
var e = inEvent;
|
||||
if (goog.isNumber(inEvent.getBrowserEvent().pointerType)) {
|
||||
e = this.dispatcher.cloneEvent(inEvent, inEvent.getBrowserEvent());
|
||||
e.pointerType = this.POINTER_TYPES[inEvent.getBrowserEvent().pointerType];
|
||||
if (goog.isNumber(inEvent.pointerType)) {
|
||||
e = this.dispatcher.cloneEvent(inEvent, inEvent);
|
||||
e.pointerType = this.POINTER_TYPES[inEvent.pointerType];
|
||||
}
|
||||
|
||||
return e;
|
||||
@@ -103,10 +103,10 @@ ol.pointer.MsSource.prototype.cleanup = function(pointerId) {
|
||||
/**
|
||||
* Handler for `msPointerDown`.
|
||||
*
|
||||
* @param {goog.events.BrowserEvent} inEvent The in event.
|
||||
* @param {Event} inEvent The in event.
|
||||
*/
|
||||
ol.pointer.MsSource.prototype.msPointerDown = function(inEvent) {
|
||||
this.pointerMap[inEvent.getBrowserEvent().pointerId.toString()] = inEvent;
|
||||
this.pointerMap[inEvent.pointerId.toString()] = inEvent;
|
||||
var e = this.prepareEvent_(inEvent);
|
||||
this.dispatcher.down(e, inEvent);
|
||||
};
|
||||
@@ -115,7 +115,7 @@ ol.pointer.MsSource.prototype.msPointerDown = function(inEvent) {
|
||||
/**
|
||||
* Handler for `msPointerMove`.
|
||||
*
|
||||
* @param {goog.events.BrowserEvent} inEvent The in event.
|
||||
* @param {Event} inEvent The in event.
|
||||
*/
|
||||
ol.pointer.MsSource.prototype.msPointerMove = function(inEvent) {
|
||||
var e = this.prepareEvent_(inEvent);
|
||||
@@ -126,19 +126,19 @@ ol.pointer.MsSource.prototype.msPointerMove = function(inEvent) {
|
||||
/**
|
||||
* Handler for `msPointerUp`.
|
||||
*
|
||||
* @param {goog.events.BrowserEvent} inEvent The in event.
|
||||
* @param {Event} inEvent The in event.
|
||||
*/
|
||||
ol.pointer.MsSource.prototype.msPointerUp = function(inEvent) {
|
||||
var e = this.prepareEvent_(inEvent);
|
||||
this.dispatcher.up(e, inEvent);
|
||||
this.cleanup(inEvent.getBrowserEvent().pointerId);
|
||||
this.cleanup(inEvent.pointerId);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Handler for `msPointerOut`.
|
||||
*
|
||||
* @param {goog.events.BrowserEvent} inEvent The in event.
|
||||
* @param {Event} inEvent The in event.
|
||||
*/
|
||||
ol.pointer.MsSource.prototype.msPointerOut = function(inEvent) {
|
||||
var e = this.prepareEvent_(inEvent);
|
||||
@@ -149,7 +149,7 @@ ol.pointer.MsSource.prototype.msPointerOut = function(inEvent) {
|
||||
/**
|
||||
* Handler for `msPointerOver`.
|
||||
*
|
||||
* @param {goog.events.BrowserEvent} inEvent The in event.
|
||||
* @param {Event} inEvent The in event.
|
||||
*/
|
||||
ol.pointer.MsSource.prototype.msPointerOver = function(inEvent) {
|
||||
var e = this.prepareEvent_(inEvent);
|
||||
@@ -160,23 +160,23 @@ ol.pointer.MsSource.prototype.msPointerOver = function(inEvent) {
|
||||
/**
|
||||
* Handler for `msPointerCancel`.
|
||||
*
|
||||
* @param {goog.events.BrowserEvent} inEvent The in event.
|
||||
* @param {Event} inEvent The in event.
|
||||
*/
|
||||
ol.pointer.MsSource.prototype.msPointerCancel = function(inEvent) {
|
||||
var e = this.prepareEvent_(inEvent);
|
||||
this.dispatcher.cancel(e, inEvent);
|
||||
this.cleanup(inEvent.getBrowserEvent().pointerId);
|
||||
this.cleanup(inEvent.pointerId);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Handler for `msLostPointerCapture`.
|
||||
*
|
||||
* @param {goog.events.BrowserEvent} inEvent The in event.
|
||||
* @param {Event} inEvent The in event.
|
||||
*/
|
||||
ol.pointer.MsSource.prototype.msLostPointerCapture = function(inEvent) {
|
||||
var e = this.dispatcher.makeEvent('lostpointercapture',
|
||||
inEvent.getBrowserEvent(), inEvent);
|
||||
inEvent, inEvent);
|
||||
this.dispatcher.dispatchEvent(e);
|
||||
};
|
||||
|
||||
@@ -184,10 +184,10 @@ ol.pointer.MsSource.prototype.msLostPointerCapture = function(inEvent) {
|
||||
/**
|
||||
* Handler for `msGotPointerCapture`.
|
||||
*
|
||||
* @param {goog.events.BrowserEvent} inEvent The in event.
|
||||
* @param {Event} inEvent The in event.
|
||||
*/
|
||||
ol.pointer.MsSource.prototype.msGotPointerCapture = function(inEvent) {
|
||||
var e = this.dispatcher.makeEvent('gotpointercapture',
|
||||
inEvent.getBrowserEvent(), inEvent);
|
||||
inEvent, inEvent);
|
||||
this.dispatcher.dispatchEvent(e);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user