Skip to content

Commit

Permalink
Revert "remove pointer events test as it's not reliable. ref #80"
Browse files Browse the repository at this point in the history
It's totally fine.

This reverts commit 284a859.
  • Loading branch information
paulirish committed May 1, 2012
1 parent 23d1f8d commit db2a1f8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions feature-detects/css-pointerevents.js
@@ -0,0 +1,18 @@
// developer.mozilla.org/en/CSS/pointer-events
// github.com/ausi/Feature-detection-technique-for-pointer-events
Modernizr.addTest('pointerevents', function(){
var element = document.createElement('x'),
documentElement = document.documentElement,
getComputedStyle = window.getComputedStyle,
supports;
if(!('pointerEvents' in element.style)){
return false;
}
element.style.pointerEvents = 'auto';
element.style.pointerEvents = 'x';
documentElement.appendChild(element);
supports = getComputedStyle &&
getComputedStyle(element, '').pointerEvents === 'auto';
documentElement.removeChild(element);
return !!supports;
});

0 comments on commit db2a1f8

Please sign in to comment.