Skip to content

Commit

Permalink
Allow pointer events to be used if supported
Browse files Browse the repository at this point in the history
  • Loading branch information
adroitwhiz committed May 19, 2020
1 parent 9de1d4a commit 6244701
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/view/View.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ var View = Base.extend(Emitter, /** @lends View# */{
DomElement.setPrefixed(element.style, {
userDrag: none,
userSelect: none,
// Prevent pointer events from doing things like panning the page
touchAction: none,
touchCallout: none,
contentZooming: none,
tapHighlightColor: 'rgba(0,0,0,0)'
Expand Down Expand Up @@ -1070,7 +1072,7 @@ new function() { // Injection scope for event handling on the browser
// Touch handling inspired by Hammer.js
var navigator = window.navigator,
mousedown, mousemove, mouseup;
if (navigator.pointerEnabled || navigator.msPointerEnabled) {
if (window.PointerEvent || navigator.msPointerEnabled) {
// HTML5 / MS pointer events
mousedown = 'pointerdown MSPointerDown';
mousemove = 'pointermove MSPointerMove';
Expand Down

0 comments on commit 6244701

Please sign in to comment.