Allow touchmode for Microsoft Surface tablets

'ontouchstart' wasn't enough to detect touch on MS Surface devices
This commit is contained in:
samhed 2016-05-13 16:30:10 +02:00
parent f52105bc88
commit b14c73afd1
1 changed files with 4 additions and 1 deletions

View File

@ -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();