From 36ba7852dd91d140a923071cb22fd40998821c23 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 1 May 2017 12:12:51 -0400 Subject: shouldPreventDefault --- bundle.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'bundle.js') diff --git a/bundle.js b/bundle.js index f3cc5fe..07ad2db 100644 --- a/bundle.js +++ b/bundle.js @@ -23073,7 +23073,7 @@ var hexes = void 0, function init() { if (_util.browser.isMobile) { document.addEventListener('touchstart', touch(down)); - document.addEventListener('touchmove', touch(move)); + document.addEventListener('touchmove', touch(move, true)); document.addEventListener('touchend', touch(up)); } else { document.addEventListener('mousedown', down); @@ -23181,9 +23181,10 @@ function find(hex) { if (id in hexes) return hexes[id]; return null; } -function touch(fn) { +function touch(fn, shouldPreventDefault) { return function (e) { - return fn(e.touches[0]); + shouldPreventDefault && e.preventDefault(); + fn(e.touches[0]); }; } function polygon(n, side) { -- cgit v1.2.3-70-g09d2