Remove TOUCH, POINTER and MSPOINTER from ol/has

This commit is contained in:
Frederic Junod
2019-05-31 12:35:59 +01:00
parent 579d05a0cb
commit 7c215b2532
5 changed files with 17 additions and 35 deletions

View File

@@ -34,7 +34,6 @@
import {listen, unlisten} from '../events.js';
import EventTarget from '../events/Target.js';
import {POINTER, MSPOINTER, TOUCH} from '../has.js';
import PointerEventType from './EventType.js';
import MouseSource, {prepareEvent as prepareMouseEvent} from './MouseSource.js';
import MsSource from './MsSource.js';
@@ -124,15 +123,15 @@ class PointerEventHandler extends EventTarget {
* that generate pointer events.
*/
registerSources() {
if (POINTER) {
if ('PointerEvent' in window) {
this.registerSource('native', new NativeSource(this));
} else if (MSPOINTER) {
} else if (window.navigator.msPointerEnabled) {
this.registerSource('ms', new MsSource(this));
} else {
const mouseSource = new MouseSource(this);
this.registerSource('mouse', mouseSource);
if (TOUCH) {
if ('ontouchstart' in window) {
this.registerSource('touch', new TouchSource(this, mouseSource));
}
}