Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
support: update to latest version of support
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Schmitz committed Jan 2, 2013
1 parent 69c96ca commit 85338cf
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions js/jquery.mobile.support.js
Expand Up @@ -33,20 +33,24 @@ function validStyle( prop, value, check_vend ) {
return txt.charAt( 0 ).toUpperCase() + txt.substr( 1 );
},
vend_pref = function( vend ) {
return "-" + vend.charAt( 0 ).toLowerCase() + vend.substr( 1 ) + "-";
if( vend === "" ) {
return "";
} else {
return "-" + vend.charAt( 0 ).toLowerCase() + vend.substr( 1 ) + "-";
}
},
check_style = function( vend ) {
var vend_prop = vend_pref( vend ) + prop + ": " + value + ";",
uc_vend = uc( vend ),
propStyle = uc_vend + uc( prop );
propStyle = uc_vend + ( uc_vend === "" ? prop : uc( prop ) );

div.setAttribute( "style", vend_prop );

if ( !!div.style[ propStyle ] ) {
ret = true;
}
},
check_vends = check_vend ? [ check_vend ] : vendors,
check_vends = check_vend ? check_vend : vendors,
ret;

for( var i = 0; i < check_vends.length; i++ ) {
Expand All @@ -55,10 +59,10 @@ function validStyle( prop, value, check_vend ) {
return !!ret;
}

// Thanks to Modernizr src for this test idea. `perspective` check is limited to Moz to prevent a false positive for 3D transforms on Android.
// Thanks to Modernizr src for this test idea. `perspective` check is limited to Moz/unprefixed to prevent a false positive for 3D transforms on Android.
function transform3dTest() {
var prop = "transform-3d";
return validStyle( 'perspective', '10px', 'moz' ) || $.mobile.media( "(-" + vendors.join( "-" + prop + "),(-" ) + "-" + prop + "),(" + prop + ")" );
return validStyle( 'perspective', '10px', ['moz', ''] ) || $.mobile.media( "(-" + vendors.join( "-" + prop + "),(-" ) + "-" + prop + "),(" + prop + ")" );
}

// Test for dynamic-updating base tag support ( allows us to avoid href,src attr rewriting )
Expand Down Expand Up @@ -190,4 +194,4 @@ if ( !$.support.boxShadow ) {
})( jQuery );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
//>>excludeEnd("jqmBuildExclude");
//>>excludeEnd("jqmBuildExclude");

0 comments on commit 85338cf

Please sign in to comment.