Merge pull request #7923 from ahocevar/fix-pointer-static

Fix exports and use of constants
This commit is contained in:
Andreas Hocevar
2018-03-04 15:03:17 +01:00
committed by GitHub
3 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -19,7 +19,7 @@ import LineString from '../geom/LineString.js';
import MultiLineString from '../geom/MultiLineString.js'; import MultiLineString from '../geom/MultiLineString.js';
import MultiPoint from '../geom/MultiPoint.js'; import MultiPoint from '../geom/MultiPoint.js';
import MultiPolygon from '../geom/MultiPolygon.js'; import MultiPolygon from '../geom/MultiPolygon.js';
import MouseSource from '../pointer/MouseSource.js'; import {POINTER_TYPE} from '../pointer/MouseSource.js';
import Point from '../geom/Point.js'; import Point from '../geom/Point.js';
import Polygon, {fromCircle, makeRegular} from '../geom/Polygon.js'; import Polygon, {fromCircle, makeRegular} from '../geom/Polygon.js';
import PointerInteraction, {handleEvent as handlePointerEvent} from '../interaction/Pointer.js'; import PointerInteraction, {handleEvent as handlePointerEvent} from '../interaction/Pointer.js';
@@ -435,7 +435,7 @@ export function handleEvent(event) {
pass = event.type === MapBrowserEventType.POINTERMOVE; pass = event.type === MapBrowserEventType.POINTERMOVE;
if (pass && this.freehand_) { if (pass && this.freehand_) {
pass = this.handlePointerMove_(event); pass = this.handlePointerMove_(event);
} else if (event.pointerEvent.pointerType == MouseSource.POINTER_TYPE || } else if (event.pointerEvent.pointerType == POINTER_TYPE ||
(event.type === MapBrowserEventType.POINTERDRAG && !this.downTimeout_)) { (event.type === MapBrowserEventType.POINTERDRAG && !this.downTimeout_)) {
this.handlePointerMove_(event); this.handlePointerMove_(event);
} }
+1 -1
View File
@@ -74,7 +74,7 @@ export const POINTER_ID = 1;
/** /**
* @type {string} * @type {string}
*/ */
const POINTER_TYPE = 'mouse'; export const POINTER_TYPE = 'mouse';
/** /**
+2 -2
View File
@@ -199,7 +199,7 @@ inherits(PointerEvent, Event);
* Is the `buttons` property supported? * Is the `buttons` property supported?
* @type {boolean} * @type {boolean}
*/ */
const HAS_BUTTONS = false; let HAS_BUTTONS = false;
/** /**
@@ -269,7 +269,7 @@ PointerEvent.prototype.getPressure_ = function(eventDict, buttons) {
(function() { (function() {
try { try {
const ev = new MouseEvent('click', {buttons: 1}); const ev = new MouseEvent('click', {buttons: 1});
PointerEvent.HAS_BUTTONS = ev.buttons === 1; HAS_BUTTONS = ev.buttons === 1;
} catch (e) { } catch (e) {
// pass // pass
} }