wider detection of touch events (#5406)

* wider detection
* node...
This commit is contained in:
Andrea Bogazzi 2018-11-23 09:10:30 +01:00 committed by GitHub
parent 3b314d11cc
commit 0927a70a64
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -32,7 +32,8 @@ else {
* True when in environment that supports touch events
* @type boolean
*/
fabric.isTouchSupported = 'ontouchstart' in fabric.window;
fabric.isTouchSupported = 'ontouchstart' in fabric.window || 'ontouchstart' in fabric.document ||
(fabric.window && fabric.window.navigator && fabric.window.navigator.maxTouchPoints > 0);
/**
* True when in environment that's probably Node.js