Rename _ol_pointer_MsSource_ to MsSource
This commit is contained in:
@@ -39,7 +39,7 @@ import EventSource from '../pointer/EventSource.js';
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.pointer.EventSource}
|
* @extends {ol.pointer.EventSource}
|
||||||
*/
|
*/
|
||||||
const _ol_pointer_MsSource_ = function(dispatcher) {
|
const MsSource = function(dispatcher) {
|
||||||
const mapping = {
|
const mapping = {
|
||||||
'MSPointerDown': this.msPointerDown,
|
'MSPointerDown': this.msPointerDown,
|
||||||
'MSPointerMove': this.msPointerMove,
|
'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.
|
* @param {Event} inEvent The in event.
|
||||||
* @return {Object} The copied event.
|
* @return {Object} The copied event.
|
||||||
*/
|
*/
|
||||||
_ol_pointer_MsSource_.prototype.prepareEvent_ = function(inEvent) {
|
MsSource.prototype.prepareEvent_ = function(inEvent) {
|
||||||
let e = inEvent;
|
let e = inEvent;
|
||||||
if (typeof inEvent.pointerType === 'number') {
|
if (typeof inEvent.pointerType === 'number') {
|
||||||
e = this.dispatcher.cloneEvent(inEvent, inEvent);
|
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.
|
* Remove this pointer from the list of active pointers.
|
||||||
* @param {number} pointerId Pointer identifier.
|
* @param {number} pointerId Pointer identifier.
|
||||||
*/
|
*/
|
||||||
_ol_pointer_MsSource_.prototype.cleanup = function(pointerId) {
|
MsSource.prototype.cleanup = function(pointerId) {
|
||||||
delete this.pointerMap[pointerId.toString()];
|
delete this.pointerMap[pointerId.toString()];
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ _ol_pointer_MsSource_.prototype.cleanup = function(pointerId) {
|
|||||||
*
|
*
|
||||||
* @param {Event} inEvent The in event.
|
* @param {Event} inEvent The in event.
|
||||||
*/
|
*/
|
||||||
_ol_pointer_MsSource_.prototype.msPointerDown = function(inEvent) {
|
MsSource.prototype.msPointerDown = function(inEvent) {
|
||||||
this.pointerMap[inEvent.pointerId.toString()] = inEvent;
|
this.pointerMap[inEvent.pointerId.toString()] = inEvent;
|
||||||
const e = this.prepareEvent_(inEvent);
|
const e = this.prepareEvent_(inEvent);
|
||||||
this.dispatcher.down(e, inEvent);
|
this.dispatcher.down(e, inEvent);
|
||||||
@@ -119,7 +119,7 @@ _ol_pointer_MsSource_.prototype.msPointerDown = function(inEvent) {
|
|||||||
*
|
*
|
||||||
* @param {Event} inEvent The in event.
|
* @param {Event} inEvent The in event.
|
||||||
*/
|
*/
|
||||||
_ol_pointer_MsSource_.prototype.msPointerMove = function(inEvent) {
|
MsSource.prototype.msPointerMove = function(inEvent) {
|
||||||
const e = this.prepareEvent_(inEvent);
|
const e = this.prepareEvent_(inEvent);
|
||||||
this.dispatcher.move(e, inEvent);
|
this.dispatcher.move(e, inEvent);
|
||||||
};
|
};
|
||||||
@@ -130,7 +130,7 @@ _ol_pointer_MsSource_.prototype.msPointerMove = function(inEvent) {
|
|||||||
*
|
*
|
||||||
* @param {Event} inEvent The in event.
|
* @param {Event} inEvent The in event.
|
||||||
*/
|
*/
|
||||||
_ol_pointer_MsSource_.prototype.msPointerUp = function(inEvent) {
|
MsSource.prototype.msPointerUp = function(inEvent) {
|
||||||
const e = this.prepareEvent_(inEvent);
|
const e = this.prepareEvent_(inEvent);
|
||||||
this.dispatcher.up(e, inEvent);
|
this.dispatcher.up(e, inEvent);
|
||||||
this.cleanup(inEvent.pointerId);
|
this.cleanup(inEvent.pointerId);
|
||||||
@@ -142,7 +142,7 @@ _ol_pointer_MsSource_.prototype.msPointerUp = function(inEvent) {
|
|||||||
*
|
*
|
||||||
* @param {Event} inEvent The in event.
|
* @param {Event} inEvent The in event.
|
||||||
*/
|
*/
|
||||||
_ol_pointer_MsSource_.prototype.msPointerOut = function(inEvent) {
|
MsSource.prototype.msPointerOut = function(inEvent) {
|
||||||
const e = this.prepareEvent_(inEvent);
|
const e = this.prepareEvent_(inEvent);
|
||||||
this.dispatcher.leaveOut(e, inEvent);
|
this.dispatcher.leaveOut(e, inEvent);
|
||||||
};
|
};
|
||||||
@@ -153,7 +153,7 @@ _ol_pointer_MsSource_.prototype.msPointerOut = function(inEvent) {
|
|||||||
*
|
*
|
||||||
* @param {Event} inEvent The in event.
|
* @param {Event} inEvent The in event.
|
||||||
*/
|
*/
|
||||||
_ol_pointer_MsSource_.prototype.msPointerOver = function(inEvent) {
|
MsSource.prototype.msPointerOver = function(inEvent) {
|
||||||
const e = this.prepareEvent_(inEvent);
|
const e = this.prepareEvent_(inEvent);
|
||||||
this.dispatcher.enterOver(e, inEvent);
|
this.dispatcher.enterOver(e, inEvent);
|
||||||
};
|
};
|
||||||
@@ -164,7 +164,7 @@ _ol_pointer_MsSource_.prototype.msPointerOver = function(inEvent) {
|
|||||||
*
|
*
|
||||||
* @param {Event} inEvent The in event.
|
* @param {Event} inEvent The in event.
|
||||||
*/
|
*/
|
||||||
_ol_pointer_MsSource_.prototype.msPointerCancel = function(inEvent) {
|
MsSource.prototype.msPointerCancel = function(inEvent) {
|
||||||
const e = this.prepareEvent_(inEvent);
|
const e = this.prepareEvent_(inEvent);
|
||||||
this.dispatcher.cancel(e, inEvent);
|
this.dispatcher.cancel(e, inEvent);
|
||||||
this.cleanup(inEvent.pointerId);
|
this.cleanup(inEvent.pointerId);
|
||||||
@@ -176,7 +176,7 @@ _ol_pointer_MsSource_.prototype.msPointerCancel = function(inEvent) {
|
|||||||
*
|
*
|
||||||
* @param {Event} inEvent The in event.
|
* @param {Event} inEvent The in event.
|
||||||
*/
|
*/
|
||||||
_ol_pointer_MsSource_.prototype.msLostPointerCapture = function(inEvent) {
|
MsSource.prototype.msLostPointerCapture = function(inEvent) {
|
||||||
const e = this.dispatcher.makeEvent('lostpointercapture',
|
const e = this.dispatcher.makeEvent('lostpointercapture',
|
||||||
inEvent, inEvent);
|
inEvent, inEvent);
|
||||||
this.dispatcher.dispatchEvent(e);
|
this.dispatcher.dispatchEvent(e);
|
||||||
@@ -188,9 +188,9 @@ _ol_pointer_MsSource_.prototype.msLostPointerCapture = function(inEvent) {
|
|||||||
*
|
*
|
||||||
* @param {Event} inEvent The in event.
|
* @param {Event} inEvent The in event.
|
||||||
*/
|
*/
|
||||||
_ol_pointer_MsSource_.prototype.msGotPointerCapture = function(inEvent) {
|
MsSource.prototype.msGotPointerCapture = function(inEvent) {
|
||||||
const e = this.dispatcher.makeEvent('gotpointercapture',
|
const e = this.dispatcher.makeEvent('gotpointercapture',
|
||||||
inEvent, inEvent);
|
inEvent, inEvent);
|
||||||
this.dispatcher.dispatchEvent(e);
|
this.dispatcher.dispatchEvent(e);
|
||||||
};
|
};
|
||||||
export default _ol_pointer_MsSource_;
|
export default MsSource;
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ import EventTarget from '../events/EventTarget.js';
|
|||||||
import _ol_has_ from '../has.js';
|
import _ol_has_ from '../has.js';
|
||||||
import PointerEventType from '../pointer/EventType.js';
|
import PointerEventType from '../pointer/EventType.js';
|
||||||
import MouseSource from '../pointer/MouseSource.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 NativeSource from '../pointer/NativeSource.js';
|
||||||
import PointerEvent from '../pointer/PointerEvent.js';
|
import PointerEvent from '../pointer/PointerEvent.js';
|
||||||
import TouchSource from '../pointer/TouchSource.js';
|
import TouchSource from '../pointer/TouchSource.js';
|
||||||
@@ -89,7 +89,7 @@ PointerEventHandler.prototype.registerSources = function() {
|
|||||||
if (_ol_has_.POINTER) {
|
if (_ol_has_.POINTER) {
|
||||||
this.registerSource('native', new NativeSource(this));
|
this.registerSource('native', new NativeSource(this));
|
||||||
} else if (_ol_has_.MSPOINTER) {
|
} else if (_ol_has_.MSPOINTER) {
|
||||||
this.registerSource('ms', new _ol_pointer_MsSource_(this));
|
this.registerSource('ms', new MsSource(this));
|
||||||
} else {
|
} else {
|
||||||
const mouseSource = new MouseSource(this);
|
const mouseSource = new MouseSource(this);
|
||||||
this.registerSource('mouse', mouseSource);
|
this.registerSource('mouse', mouseSource);
|
||||||
|
|||||||
Reference in New Issue
Block a user