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

Commit 85338cf

Browse files
author
Alexander Schmitz
committed
support: update to latest version of support
1 parent 69c96ca commit 85338cf

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

js/jquery.mobile.support.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,24 @@ function validStyle( prop, value, check_vend ) {
3333
return txt.charAt( 0 ).toUpperCase() + txt.substr( 1 );
3434
},
3535
vend_pref = function( vend ) {
36-
return "-" + vend.charAt( 0 ).toLowerCase() + vend.substr( 1 ) + "-";
36+
if( vend === "" ) {
37+
return "";
38+
} else {
39+
return "-" + vend.charAt( 0 ).toLowerCase() + vend.substr( 1 ) + "-";
40+
}
3741
},
3842
check_style = function( vend ) {
3943
var vend_prop = vend_pref( vend ) + prop + ": " + value + ";",
4044
uc_vend = uc( vend ),
41-
propStyle = uc_vend + uc( prop );
45+
propStyle = uc_vend + ( uc_vend === "" ? prop : uc( prop ) );
4246

4347
div.setAttribute( "style", vend_prop );
4448

4549
if ( !!div.style[ propStyle ] ) {
4650
ret = true;
4751
}
4852
},
49-
check_vends = check_vend ? [ check_vend ] : vendors,
53+
check_vends = check_vend ? check_vend : vendors,
5054
ret;
5155

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

58-
// Thanks to Modernizr src for this test idea. `perspective` check is limited to Moz to prevent a false positive for 3D transforms on Android.
62+
// 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.
5963
function transform3dTest() {
6064
var prop = "transform-3d";
61-
return validStyle( 'perspective', '10px', 'moz' ) || $.mobile.media( "(-" + vendors.join( "-" + prop + "),(-" ) + "-" + prop + "),(" + prop + ")" );
65+
return validStyle( 'perspective', '10px', ['moz', ''] ) || $.mobile.media( "(-" + vendors.join( "-" + prop + "),(-" ) + "-" + prop + "),(" + prop + ")" );
6266
}
6367

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

0 commit comments

Comments
 (0)