Named exports from ol/has

This commit is contained in:
Tim Schaub
2018-02-05 10:10:17 -07:00
parent 348afc4e44
commit 9cfee0f40b
26 changed files with 222 additions and 185 deletions

View File

@@ -34,7 +34,7 @@
import {inherits} from '../index.js';
import {listen, unlisten} from '../events.js';
import EventTarget from '../events/EventTarget.js';
import _ol_has_ from '../has.js';
import {POINTER, MSPOINTER, TOUCH} from '../has.js';
import PointerEventType from '../pointer/EventType.js';
import MouseSource from '../pointer/MouseSource.js';
import MsSource from '../pointer/MsSource.js';
@@ -86,15 +86,15 @@ inherits(PointerEventHandler, EventTarget);
* that generate pointer events.
*/
PointerEventHandler.prototype.registerSources = function() {
if (_ol_has_.POINTER) {
if (POINTER) {
this.registerSource('native', new NativeSource(this));
} else if (_ol_has_.MSPOINTER) {
} else if (MSPOINTER) {
this.registerSource('ms', new MsSource(this));
} else {
const mouseSource = new MouseSource(this);
this.registerSource('mouse', mouseSource);
if (_ol_has_.TOUCH) {
if (TOUCH) {
this.registerSource('touch', new TouchSource(this, mouseSource));
}
}