New way of detecting touch

Moves detection to Util and fixes so that touch is properly detected on
MS Surface and touch emulation in Chrome.
This commit is contained in:
samhed
2016-08-25 14:21:32 +02:00
committed by Samuel Mannehed
parent da346c3b21
commit bea2b3fdfc
4 changed files with 25 additions and 15 deletions

View File

@@ -119,7 +119,7 @@
mouse.grab();
message("Display initialized");
if ('ontouchstart' in document.documentElement) {
if (Util.isTouchDevice) {
message("Touch device detected");
document.getElementById('button-selection').style.display = "inline";
document.getElementById('button1').onclick = function(){ selectButton(1) };