-
+
diff --git a/js/jquery.mobile.js b/js/jquery.mobile.js
index f096bb35..e1ed9344 100644
--- a/js/jquery.mobile.js
+++ b/js/jquery.mobile.js
@@ -8,7 +8,7 @@
*/
(function( jQuery, window, undefined ) {
// if we're missing support for any of these, then we're a C-grade browser
- if ( !jQuery.support.display || !jQuery.support.position || !jQuery.support.overflow || !jQuery.support.floatclear ) {
+ if ( !jQuery.support.mediaquery ) {
return;
}
@@ -255,7 +255,7 @@
$html.addClass('ui-mobile');
//insert mobile meta - these will need to be configurable somehow.
- $head.append(''+
+ $head.append(''+
''+
''+
'' +
diff --git a/js/jquery.mobile.support.js b/js/jquery.mobile.support.js
index ffa9398d..e570421a 100644
--- a/js/jquery.mobile.support.js
+++ b/js/jquery.mobile.support.js
@@ -4,11 +4,33 @@ Possible additions:
CSS Matrix
*/
+// test whether a CSS media type or query applies
+$.media = (function() {
+ // TODO: use window.matchMedia once at least one UA implements it
+ var cache = {},
+ $html = $( "html" ),
+ testDiv = $( "
" ),
+ fakeBody = $( "" ).append( testDiv );
+
+ return function( query ) {
+ if ( !( query in cache ) ) {
+ var styleBlock = $( "" );
+ $html.prepend( fakeBody ).prepend( styleBlock );
+ cache[ query ] = testDiv.css( "position" ) === "absolute";
+ fakeBody.add( styleBlock ).remove();
+ }
+ return cache[ query ];
+ };
+})();
+
$.extend( $.support, {
orientation: "orientation" in window,
touch: "ontouchend" in document,
WebKitAnimationEvent: typeof WebKitTransitionEvent === "object",
- pushState: !!history.pushState
+ pushState: !!history.pushState,
+ mediaquery: $.media('only all')
});
(function() {
@@ -43,24 +65,3 @@ $.extend( $.support, {
fakeBody.remove();
})();
-
-// test whether a CSS media type or query applies
-$.media = (function() {
- // TODO: use window.matchMedia once at least one UA implements it
- var cache = {},
- $html = $( "html" ),
- testDiv = $( "