summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsamhed <samuel@cendio.se>2016-05-13 16:30:10 +0200
committersamhed <samuel@cendio.se>2016-05-13 16:30:10 +0200
commitb14c73afd129a1db78ded6783da729cb7be87309 (patch)
tree8115379802518826347bd1c1a08beeb5844ee3f0
parentf52105bc88ebd18d5cb3fba817173e99600cdc3f (diff)
downloadnovnc-surfacetouch.tar.gz
Allow touchmode for Microsoft Surface tabletssurfacetouch
'ontouchstart' wasn't enough to detect touch on MS Surface devices
-rw-r--r--include/ui.js5
1 files changed, 4 insertions, 1 deletions
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();