From aeee8e67a90dfeb4173c76c05a8e1765acdc39bd Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Wed, 17 Jan 2018 12:01:20 +0100 Subject: [PATCH] Rename _ol_pointer_MsSource_ to MsSource --- src/ol/pointer/MsSource.js | 26 +++++++++++++------------- src/ol/pointer/PointerEventHandler.js | 4 ++-- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/ol/pointer/MsSource.js b/src/ol/pointer/MsSource.js index 683b0dc0c6..d59265e893 100644 --- a/src/ol/pointer/MsSource.js +++ b/src/ol/pointer/MsSource.js @@ -39,7 +39,7 @@ import EventSource from '../pointer/EventSource.js'; * @constructor * @extends {ol.pointer.EventSource} */ -const _ol_pointer_MsSource_ = function(dispatcher) { +const MsSource = function(dispatcher) { const mapping = { 'MSPointerDown': this.msPointerDown, 'MSPointerMove': this.msPointerMove, @@ -71,7 +71,7 @@ const _ol_pointer_MsSource_ = function(dispatcher) { ]; }; -inherits(_ol_pointer_MsSource_, EventSource); +inherits(MsSource, EventSource); /** @@ -82,7 +82,7 @@ inherits(_ol_pointer_MsSource_, EventSource); * @param {Event} inEvent The in event. * @return {Object} The copied event. */ -_ol_pointer_MsSource_.prototype.prepareEvent_ = function(inEvent) { +MsSource.prototype.prepareEvent_ = function(inEvent) { let e = inEvent; if (typeof inEvent.pointerType === 'number') { e = this.dispatcher.cloneEvent(inEvent, inEvent); @@ -97,7 +97,7 @@ _ol_pointer_MsSource_.prototype.prepareEvent_ = function(inEvent) { * Remove this pointer from the list of active pointers. * @param {number} pointerId Pointer identifier. */ -_ol_pointer_MsSource_.prototype.cleanup = function(pointerId) { +MsSource.prototype.cleanup = function(pointerId) { delete this.pointerMap[pointerId.toString()]; }; @@ -107,7 +107,7 @@ _ol_pointer_MsSource_.prototype.cleanup = function(pointerId) { * * @param {Event} inEvent The in event. */ -_ol_pointer_MsSource_.prototype.msPointerDown = function(inEvent) { +MsSource.prototype.msPointerDown = function(inEvent) { this.pointerMap[inEvent.pointerId.toString()] = inEvent; const e = this.prepareEvent_(inEvent); this.dispatcher.down(e, inEvent); @@ -119,7 +119,7 @@ _ol_pointer_MsSource_.prototype.msPointerDown = function(inEvent) { * * @param {Event} inEvent The in event. */ -_ol_pointer_MsSource_.prototype.msPointerMove = function(inEvent) { +MsSource.prototype.msPointerMove = function(inEvent) { const e = this.prepareEvent_(inEvent); this.dispatcher.move(e, inEvent); }; @@ -130,7 +130,7 @@ _ol_pointer_MsSource_.prototype.msPointerMove = function(inEvent) { * * @param {Event} inEvent The in event. */ -_ol_pointer_MsSource_.prototype.msPointerUp = function(inEvent) { +MsSource.prototype.msPointerUp = function(inEvent) { const e = this.prepareEvent_(inEvent); this.dispatcher.up(e, inEvent); this.cleanup(inEvent.pointerId); @@ -142,7 +142,7 @@ _ol_pointer_MsSource_.prototype.msPointerUp = function(inEvent) { * * @param {Event} inEvent The in event. */ -_ol_pointer_MsSource_.prototype.msPointerOut = function(inEvent) { +MsSource.prototype.msPointerOut = function(inEvent) { const e = this.prepareEvent_(inEvent); this.dispatcher.leaveOut(e, inEvent); }; @@ -153,7 +153,7 @@ _ol_pointer_MsSource_.prototype.msPointerOut = function(inEvent) { * * @param {Event} inEvent The in event. */ -_ol_pointer_MsSource_.prototype.msPointerOver = function(inEvent) { +MsSource.prototype.msPointerOver = function(inEvent) { const e = this.prepareEvent_(inEvent); this.dispatcher.enterOver(e, inEvent); }; @@ -164,7 +164,7 @@ _ol_pointer_MsSource_.prototype.msPointerOver = function(inEvent) { * * @param {Event} inEvent The in event. */ -_ol_pointer_MsSource_.prototype.msPointerCancel = function(inEvent) { +MsSource.prototype.msPointerCancel = function(inEvent) { const e = this.prepareEvent_(inEvent); this.dispatcher.cancel(e, inEvent); this.cleanup(inEvent.pointerId); @@ -176,7 +176,7 @@ _ol_pointer_MsSource_.prototype.msPointerCancel = function(inEvent) { * * @param {Event} inEvent The in event. */ -_ol_pointer_MsSource_.prototype.msLostPointerCapture = function(inEvent) { +MsSource.prototype.msLostPointerCapture = function(inEvent) { const e = this.dispatcher.makeEvent('lostpointercapture', inEvent, inEvent); this.dispatcher.dispatchEvent(e); @@ -188,9 +188,9 @@ _ol_pointer_MsSource_.prototype.msLostPointerCapture = function(inEvent) { * * @param {Event} inEvent The in event. */ -_ol_pointer_MsSource_.prototype.msGotPointerCapture = function(inEvent) { +MsSource.prototype.msGotPointerCapture = function(inEvent) { const e = this.dispatcher.makeEvent('gotpointercapture', inEvent, inEvent); this.dispatcher.dispatchEvent(e); }; -export default _ol_pointer_MsSource_; +export default MsSource; diff --git a/src/ol/pointer/PointerEventHandler.js b/src/ol/pointer/PointerEventHandler.js index ff2698314c..26cd75e32f 100644 --- a/src/ol/pointer/PointerEventHandler.js +++ b/src/ol/pointer/PointerEventHandler.js @@ -37,7 +37,7 @@ import EventTarget from '../events/EventTarget.js'; import _ol_has_ from '../has.js'; import PointerEventType from '../pointer/EventType.js'; import MouseSource from '../pointer/MouseSource.js'; -import _ol_pointer_MsSource_ from '../pointer/MsSource.js'; +import MsSource from '../pointer/MsSource.js'; import NativeSource from '../pointer/NativeSource.js'; import PointerEvent from '../pointer/PointerEvent.js'; import TouchSource from '../pointer/TouchSource.js'; @@ -89,7 +89,7 @@ PointerEventHandler.prototype.registerSources = function() { if (_ol_has_.POINTER) { this.registerSource('native', new NativeSource(this)); } else if (_ol_has_.MSPOINTER) { - this.registerSource('ms', new _ol_pointer_MsSource_(this)); + this.registerSource('ms', new MsSource(this)); } else { const mouseSource = new MouseSource(this); this.registerSource('mouse', mouseSource);