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:
@@ -50,7 +50,7 @@ ol.pointer.MouseSource = function(dispatcher) {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {!Object.<string, goog.events.BrowserEvent|Object>}
|
||||
* @type {!Object.<string, Event|Object>}
|
||||
*/
|
||||
this.pointerMap = dispatcher.pointerMap;
|
||||
|
||||
@@ -107,7 +107,7 @@ ol.pointer.MouseSource.DEDUP_DIST = 25;
|
||||
* or detect that the positions are invalid.
|
||||
*
|
||||
* @private
|
||||
* @param {goog.events.BrowserEvent} inEvent The in event.
|
||||
* @param {Event} inEvent The in event.
|
||||
* @return {boolean} True, if the event was generated by a touch.
|
||||
*/
|
||||
ol.pointer.MouseSource.prototype.isEventSimulatedFromTouch_ = function(inEvent) {
|
||||
@@ -129,12 +129,12 @@ ol.pointer.MouseSource.prototype.isEventSimulatedFromTouch_ = function(inEvent)
|
||||
* Creates a copy of the original event that will be used
|
||||
* for the fake pointer event.
|
||||
*
|
||||
* @param {goog.events.BrowserEvent} inEvent The in event.
|
||||
* @param {Event} inEvent The in event.
|
||||
* @param {ol.pointer.PointerEventHandler} dispatcher Event handler.
|
||||
* @return {Object} The copied event.
|
||||
*/
|
||||
ol.pointer.MouseSource.prepareEvent = function(inEvent, dispatcher) {
|
||||
var e = dispatcher.cloneEvent(inEvent, inEvent.getBrowserEvent());
|
||||
var e = dispatcher.cloneEvent(inEvent, inEvent);
|
||||
|
||||
// forward mouse preventDefault
|
||||
var pd = e.preventDefault;
|
||||
@@ -154,7 +154,7 @@ ol.pointer.MouseSource.prepareEvent = function(inEvent, dispatcher) {
|
||||
/**
|
||||
* Handler for `mousedown`.
|
||||
*
|
||||
* @param {goog.events.BrowserEvent} inEvent The in event.
|
||||
* @param {Event} inEvent The in event.
|
||||
*/
|
||||
ol.pointer.MouseSource.prototype.mousedown = function(inEvent) {
|
||||
if (!this.isEventSimulatedFromTouch_(inEvent)) {
|
||||
@@ -173,7 +173,7 @@ ol.pointer.MouseSource.prototype.mousedown = function(inEvent) {
|
||||
/**
|
||||
* Handler for `mousemove`.
|
||||
*
|
||||
* @param {goog.events.BrowserEvent} inEvent The in event.
|
||||
* @param {Event} inEvent The in event.
|
||||
*/
|
||||
ol.pointer.MouseSource.prototype.mousemove = function(inEvent) {
|
||||
if (!this.isEventSimulatedFromTouch_(inEvent)) {
|
||||
@@ -186,7 +186,7 @@ ol.pointer.MouseSource.prototype.mousemove = function(inEvent) {
|
||||
/**
|
||||
* Handler for `mouseup`.
|
||||
*
|
||||
* @param {goog.events.BrowserEvent} inEvent The in event.
|
||||
* @param {Event} inEvent The in event.
|
||||
*/
|
||||
ol.pointer.MouseSource.prototype.mouseup = function(inEvent) {
|
||||
if (!this.isEventSimulatedFromTouch_(inEvent)) {
|
||||
@@ -204,7 +204,7 @@ ol.pointer.MouseSource.prototype.mouseup = function(inEvent) {
|
||||
/**
|
||||
* Handler for `mouseover`.
|
||||
*
|
||||
* @param {goog.events.BrowserEvent} inEvent The in event.
|
||||
* @param {Event} inEvent The in event.
|
||||
*/
|
||||
ol.pointer.MouseSource.prototype.mouseover = function(inEvent) {
|
||||
if (!this.isEventSimulatedFromTouch_(inEvent)) {
|
||||
@@ -217,7 +217,7 @@ ol.pointer.MouseSource.prototype.mouseover = function(inEvent) {
|
||||
/**
|
||||
* Handler for `mouseout`.
|
||||
*
|
||||
* @param {goog.events.BrowserEvent} inEvent The in event.
|
||||
* @param {Event} inEvent The in event.
|
||||
*/
|
||||
ol.pointer.MouseSource.prototype.mouseout = function(inEvent) {
|
||||
if (!this.isEventSimulatedFromTouch_(inEvent)) {
|
||||
@@ -230,7 +230,7 @@ ol.pointer.MouseSource.prototype.mouseout = function(inEvent) {
|
||||
/**
|
||||
* Dispatches a `pointercancel` event.
|
||||
*
|
||||
* @param {goog.events.BrowserEvent} inEvent The in event.
|
||||
* @param {Event} inEvent The in event.
|
||||
*/
|
||||
ol.pointer.MouseSource.prototype.cancel = function(inEvent) {
|
||||
var e = ol.pointer.MouseSource.prepareEvent(inEvent, this.dispatcher);
|
||||
|
||||
Reference in New Issue
Block a user