mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -05:00
Allow pointer events to be used if supported
This commit is contained in:
parent
112047f5ad
commit
fb7d27cb85
1 changed files with 3 additions and 1 deletions
|
@ -53,6 +53,8 @@ var View = Base.extend(Emitter, /** @lends View# */{
|
||||||
DomElement.setPrefixed(element.style, {
|
DomElement.setPrefixed(element.style, {
|
||||||
userDrag: none,
|
userDrag: none,
|
||||||
userSelect: none,
|
userSelect: none,
|
||||||
|
// Prevent pointer events from doing things like panning the page
|
||||||
|
touchAction: none,
|
||||||
touchCallout: none,
|
touchCallout: none,
|
||||||
contentZooming: none,
|
contentZooming: none,
|
||||||
tapHighlightColor: 'rgba(0,0,0,0)'
|
tapHighlightColor: 'rgba(0,0,0,0)'
|
||||||
|
@ -1069,7 +1071,7 @@ new function() { // Injection scope for event handling on the browser
|
||||||
// Touch handling inspired by Hammer.js
|
// Touch handling inspired by Hammer.js
|
||||||
var navigator = window.navigator,
|
var navigator = window.navigator,
|
||||||
mousedown, mousemove, mouseup;
|
mousedown, mousemove, mouseup;
|
||||||
if (navigator.pointerEnabled || navigator.msPointerEnabled) {
|
if (window.PointerEvent || navigator.msPointerEnabled) {
|
||||||
// HTML5 / MS pointer events
|
// HTML5 / MS pointer events
|
||||||
mousedown = 'pointerdown MSPointerDown';
|
mousedown = 'pointerdown MSPointerDown';
|
||||||
mousemove = 'pointermove MSPointerMove';
|
mousemove = 'pointermove MSPointerMove';
|
||||||
|
|
Loading…
Reference in a new issue