Rework away static members from pointer related classes

This commit is contained in:
Björn Harrtell
2018-02-24 16:24:53 +01:00
parent 3cbdb208c1
commit 6d1e8cb38b
6 changed files with 104 additions and 108 deletions

View File

@@ -57,22 +57,22 @@ const MsSource = function(dispatcher) {
* @type {!Object.<string, Event|Object>}
*/
this.pointerMap = dispatcher.pointerMap;
/**
* @const
* @type {Array.<string>}
*/
this.POINTER_TYPES = [
'',
'unavailable',
'touch',
'pen',
'mouse'
];
};
inherits(MsSource, EventSource);
/**
* @const
* @type {Array.<string>}
*/
const POINTER_TYPES = [
'',
'unavailable',
'touch',
'pen',
'mouse'
];
/**
* Creates a copy of the original event that will be used
@@ -86,7 +86,7 @@ MsSource.prototype.prepareEvent_ = function(inEvent) {
let e = inEvent;
if (typeof inEvent.pointerType === 'number') {
e = this.dispatcher.cloneEvent(inEvent, inEvent);
e.pointerType = this.POINTER_TYPES[inEvent.pointerType];
e.pointerType = POINTER_TYPES[inEvent.pointerType];
}
return e;