Skip to content

Commit

Permalink
Modernizr.touch added
Browse files Browse the repository at this point in the history
  • Loading branch information
KuraFire committed Apr 29, 2010
1 parent 8d30f5b commit 59ef6d8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions modernizr.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ window.Modernizr = (function(window,doc,undefined){
websocket = 'websocket',
flash = 'flash',
smile = ':)',
touch = 'touch',

toString = Object.prototype.toString,

Expand Down Expand Up @@ -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);
};


/**
Expand Down

0 comments on commit 59ef6d8

Please sign in to comment.