From 8a8aa1b4d3f5a5ab83116ed5699044e241c64bc6 Mon Sep 17 00:00:00 2001 From: Philipp Schaefer Date: Fri, 8 Nov 2013 19:50:59 +0100 Subject: [PATCH] added function to detect touch-devices --- code/utils_misc.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/utils_misc.js b/code/utils_misc.js index d04dda75..d4d333b5 100644 --- a/code/utils_misc.js +++ b/code/utils_misc.js @@ -459,6 +459,11 @@ window.showPortalPosLinks = function(lat, lng, name) { } } +window.isTouchDevice = function() { + return 'ontouchstart' in window // works on most browsers + || 'onmsgesturechange' in window; // works on ie10 +}; + window.androidCopy = function(text) { if(typeof android === 'undefined' || !android || !android.copy) return true; // i.e. execute other actions