Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added Modernizr's feature test for CSS pointer-events property

  • Loading branch information...
commit e083da4b2b09bb5bdaf8408cb0371bca2eef2470 1 parent 26bd1ef
@gseguin gseguin authored
Showing with 22 additions and 1 deletion.
  1. +22 −1 js/jquery.mobile.support.js
View
23 js/jquery.mobile.support.js
@@ -85,6 +85,26 @@ function baseTagTest() {
return rebase.indexOf( fauxBase ) === 0;
}
+// Thanks Modernizr
+function cssPointerEventsTest() {
+ 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;
+}
+
// non-UA-based IE version check by James Padolsey, modified by jdalton - from http://gist.github.com/527683
// allows for inclusion of IE 6+, including Windows Mobile 7
@@ -113,7 +133,8 @@ $.extend( $.support, {
cssTransform3d: transform3dTest(),
boxShadow: !!propExists( "boxShadow" ) && !bb,
scrollTop: ( "pageXOffset" in window || "scrollTop" in document.documentElement || "scrollTop" in fakeBody[ 0 ] ) && !webos && !operamini,
- dynamicBaseTag: baseTagTest()
+ dynamicBaseTag: baseTagTest(),
+ cssPointerEvents: cssPointerEventsTest()
});
fakeBody.remove();
Please sign in to comment.
Something went wrong with that request. Please try again.