summaryrefslogtreecommitdiffstats
path: root/WebContent
diff options
context:
space:
mode:
Diffstat (limited to 'WebContent')
-rw-r--r--WebContent/VAADIN/vaadinBootstrap.js16
1 files changed, 14 insertions, 2 deletions
diff --git a/WebContent/VAADIN/vaadinBootstrap.js b/WebContent/VAADIN/vaadinBootstrap.js
index 9e012ae987..f5c00a0b65 100644
--- a/WebContent/VAADIN/vaadinBootstrap.js
+++ b/WebContent/VAADIN/vaadinBootstrap.js
@@ -269,8 +269,20 @@
}
// Detect touch device support
- try { document.createEvent("TouchEvent"); url += "&v-td=1";} catch(e){};
-
+ var supportsTouch = false;
+ try {
+ document.createEvent("TouchEvent");
+ supportsTouch = true;
+ } catch (e) {
+ // Chrome and IE10 touch detection
+ supportsTouch = 'ontouchstart' in window
+ || navigator.msMaxTouchPoints;
+ }
+
+ if (supportsTouch) {
+ url += "&v-td=1";
+ }
+
return url;
}
};