diff options
| author | Jules Laplace <jules@okfoc.us> | 2017-05-01 12:12:51 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2017-05-01 12:12:51 -0400 |
| commit | 36ba7852dd91d140a923071cb22fd40998821c23 (patch) | |
| tree | b49ee097adb4d40f88678af1bd15dd9209bfea96 /bundle.js | |
| parent | f6b040e3d4474bfcc92003b9f9ce1a24b6e3cc52 (diff) | |
shouldPreventDefault
Diffstat (limited to 'bundle.js')
| -rw-r--r-- | bundle.js | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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) { |
