From b0d1063ee81487f0df8772821352df38f019bc33 Mon Sep 17 00:00:00 2001 From: scottjehl Date: Sat, 6 Nov 2010 13:44:51 -0400 Subject: [PATCH] moved device support conditions to $.mobile hash's gradeA property. Not terribly sophisticated yet, but least for now this allows for configuring device support conditions, which has been requested by users. --- js/jquery.mobile.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/js/jquery.mobile.js b/js/jquery.mobile.js index a4c466a6..7f585f94 100644 --- a/js/jquery.mobile.js +++ b/js/jquery.mobile.js @@ -7,12 +7,6 @@ * http://jquery.org/license */ (function( $, window, undefined ) { - //some critical feature tests should be placed here. - //if we're missing support for any of these, then we're a C-grade browser - //to-do: see if we need more qualifiers here. - if ( !jQuery.support.mediaquery ) { - return; - } //define jQuery.mobile hash jQuery.mobile = {}; @@ -31,9 +25,20 @@ activeBtnClass: 'ui-btn-active', //available CSS transitions - transitions: ['slide', 'slideup', 'slidedown', 'pop', 'flip', 'fade'] + transitions: ['slide', 'slideup', 'slidedown', 'pop', 'flip', 'fade'], + + //support conditions that must be met in order to proceed + gradeA: function(){ + return jQuery.support.mediaquery; + } }, jQuery.mobileDefaults); + + //if device support condition(s) aren't met, leave things as they are -> a basic, usable experience, + //otherwise, proceed with the enhancements + if ( !jQuery.mobile.gradeA() ) { + return; + } var $window = jQuery(window), $html = jQuery('html'),