From b14c73afd129a1db78ded6783da729cb7be87309 Mon Sep 17 00:00:00 2001 From: samhed Date: Fri, 13 May 2016 16:30:10 +0200 Subject: Allow touchmode for Microsoft Surface tablets 'ontouchstart' wasn't enough to detect touch on MS Surface devices --- include/ui.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/ui.js b/include/ui.js index cfdedb3..91cad7c 100644 --- a/include/ui.js +++ b/include/ui.js @@ -53,7 +53,10 @@ var UI; // Render default UI and initialize settings menu start: function(callback) { - UI.isTouchDevice = 'ontouchstart' in document.documentElement; + UI.isTouchDevice = (('ontouchstart' in window) + // required for MS Surface + || (navigator.maxTouchPoints > 0) + || (navigator.msMaxTouchPoints > 0)); // Stylesheet selection dropdown var sheet = WebUtil.selectStylesheet(); -- cgit v1.2.1