Permalink
Browse files

Provided jQuery 1.8.x and up is in play: prevents browsers that don’t…

… support getBoundingClientRect from being enhanced. jQuery 1.7.x and below are uneffected.
  • Loading branch information...
1 parent 7b05899 commit e356019c597d81ddfbe3a8b2b04b467d2e23dfc0 @Wilto Wilto committed Sep 14, 2012
Showing with 8 additions and 2 deletions.
  1. +8 −2 js/jquery.mobile.support.js
@@ -105,6 +105,10 @@ function cssPointerEventsTest() {
return !!supports;
}
+function boundingRect() {
+ var div = document.createElement( "div" );
+ return typeof div.getBoundingClientRect !== "undefined";
+}
// 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
@@ -132,7 +136,8 @@ $.extend( $.support, {
boxShadow: !!propExists( "boxShadow" ) && !bb,
scrollTop: ( "pageXOffset" in window || "scrollTop" in document.documentElement || "scrollTop" in fakeBody[ 0 ] ) && !webos && !operamini,
dynamicBaseTag: baseTagTest(),
- cssPointerEvents: cssPointerEventsTest()
+ cssPointerEvents: cssPointerEventsTest(),
+ boundingRect: boundingRect()
});
fakeBody.remove();
@@ -155,8 +160,9 @@ var nokiaLTE7_3 = (function() {
// Support conditions that must be met in order to proceed
// default enhanced qualifications are media query support OR IE 7+
+
$.mobile.gradeA = function() {
- return $.support.mediaquery || $.mobile.browser.ie && $.mobile.browser.ie >= 7;
+ return ( $.support.mediaquery || $.mobile.browser.ie && $.mobile.browser.ie >= 7 ) && ( $.support.boundingRect || $.fn.jquery.match(/[0-9]+\.[1-7]+?/) !== null );
};
$.mobile.ajaxBlacklist =

0 comments on commit e356019

Please sign in to comment.