From a13ade90ad3b3ae2813d5c1ec227cabf6ac8dba7 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Mon, 10 Mar 2014 11:43:06 +0100 Subject: [PATCH] Simplify pointerType string conversion --- src/ol/pointer/mssource.js | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/src/ol/pointer/mssource.js b/src/ol/pointer/mssource.js index 26544fc1c0..c741ae6584 100644 --- a/src/ol/pointer/mssource.js +++ b/src/ol/pointer/mssource.js @@ -49,12 +49,6 @@ ol.pointer.MsSource = function(dispatcher) { */ this.pointerMap = dispatcher.pointerMap; - /** - * @const - * @type {boolean} - */ - this.HAS_BITMAP_TYPE = this.hasBitmapType(); - /** * @private * @const @@ -98,16 +92,6 @@ ol.pointer.MsSource.prototype.getMapping = function() { }; -/** - * @suppress {missingProperties} - * @return {boolean} - */ -ol.pointer.MsSource.prototype.hasBitmapType = function() { - return window['MSPointerEvent'] && - typeof window['MSPointerEvent']['MSPOINTER_TYPE_MOUSE'] === 'number'; -}; - - /** * Creates a copy of the original event that will be used * for the fake pointer event. @@ -118,7 +102,7 @@ ol.pointer.MsSource.prototype.hasBitmapType = function() { */ ol.pointer.MsSource.prototype.prepareEvent_ = function(inEvent) { var e = inEvent; - if (this.HAS_BITMAP_TYPE) { + if (goog.isNumber(inEvent.pointerType)) { e = this.dispatcher.cloneEvent(inEvent, inEvent.getBrowserEvent()); e.pointerType = this.POINTER_TYPES[inEvent.pointerType]; }