Permalink
Browse files

Modernizr.touch added

  • Loading branch information...
KuraFire committed Apr 29, 2010
1 parent 8d30f5b commit 59ef6d8096bd715efabda3effb707bba69b1c054
Showing with 11 additions and 0 deletions.
  1. +11 −0 modernizr.js
View
@@ -125,6 +125,7 @@ window.Modernizr = (function(window,doc,undefined){
websocket = 'websocket',
flash = 'flash',
smile = ':)',
+ touch = 'touch',
toString = Object.prototype.toString,
@@ -260,6 +261,16 @@ window.Modernizr = (function(window,doc,undefined){
}
return false;
};
+
+ /**
+ * The Modernizr.touch test only indicates if the browser supports
+ * touch events; it does not necessarily detect a touchscreen
+ * device, as evidenced by tablets running Windows 7 or, alas,
+ * the Palm Pre / WebOS (touch) phones.
+ */
+ tests[touch] = function() {
+ return !!('ontouchstart' in window);
+ };
/**

0 comments on commit 59ef6d8

Please sign in to comment.