Rename _ol_pointer_MsSource_ to MsSource

This commit is contained in:
Frederic Junod
2018-01-17 12:01:20 +01:00
parent b39a6f4cae
commit aeee8e67a9
2 changed files with 15 additions and 15 deletions

View File

@@ -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;

View File

@@ -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);