From 34a6ebad406a56c13e9d77952d7640a38326a3ca Mon Sep 17 00:00:00 2001 From: John Ahlroos Date: Tue, 5 Mar 2013 10:00:53 +0200 Subject: Added IE10 touch support detection #9216 Change-Id: I3e5b2266b641901590b7806a04c6ef8c68fbe0f4 --- WebContent/VAADIN/vaadinBootstrap.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'WebContent/VAADIN') 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; } }; -- cgit v1.2.3