From 4ec1cbee550924d59ced4e0193ae348833f408b0 Mon Sep 17 00:00:00 2001 From: enition Date: Mon, 19 Aug 2019 16:53:27 +0100 Subject: [PATCH] createTouch - Deprecated createTouch has been deprecated for a while now. This fix uses the same technique used by Modernizr - https://github.com/Modernizr/Modernizr/blob/377a6303b3b6d400979eeae351e1dcf43972eef4/feature-detects/touchevents.js#L40 --- src/mouse.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mouse.js b/src/mouse.js index 0cb913a..f88f6e8 100644 --- a/src/mouse.js +++ b/src/mouse.js @@ -14,7 +14,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) { var elproto = Element.prototype, has = "hasOwnProperty", - supportsTouch = "createTouch" in glob.doc, + supportsTouch = (('ontouchstart' in window) || window.TouchEvent || window.DocumentTouch && document instanceof DocumentTouch), events = [ "click", "dblclick", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "touchstart", "touchmove", "touchend",