Skip to content

Commit

Permalink
Improved 'csspointerevents' test
Browse files Browse the repository at this point in the history
  • Loading branch information
ausi committed May 11, 2013
1 parent a0e2b25 commit 64920d2
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions feature-detects/css/pointerevents.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,10 @@
]
}
!*/
define(['Modernizr', 'createElement', 'docElement'], function( Modernizr, createElement, docElement ) {
define(['Modernizr', 'createElement'], function( Modernizr, createElement ) {
Modernizr.addTest('csspointerevents', function() {
var element = createElement('x');
var getComputedStyle = window.getComputedStyle;
var supports;
if(!('pointerEvents' in element.style)){
return false;
}
element.style.pointerEvents = 'auto';
element.style.pointerEvents = 'x';
docElement.appendChild(element);
supports = getComputedStyle &&
getComputedStyle(element, '').pointerEvents === 'auto';
docElement.removeChild(element);
return !!supports;
element.style.cssText = 'pointer-events:auto';
return element.style.pointerEvents === 'auto';
});
});

0 comments on commit 64920d2

Please sign in to comment.