Improved internal Modernizr testing function

This commit is contained in:
Brandon Mathis 2012-06-07 13:09:46 -05:00
parent f38ed3ce8d
commit af8591cc4f

View File

@ -54,12 +54,23 @@ var octopress = (function(){
});
}
, testFeatures: function () {
if (Modernizr.testAllProps('maskImage')) {
$('html').addClass('maskimage')
} else {
$('html').addClass('no-maskimage')
, testFeature: function (features) {
getTestClasses = function (tests) {
classes = '';
if (typeof(tests.join) == 'function') {
for (var i=0; i < features.length; i++)
classes += getClass(features[i]) + ' ';
} else {
classes = getClass(tests);
}
return classes;
}
getClass = function (test) {
return ((Modernizr.testAllProps(test) ? test : "no-"+features[i]).toLowerCase())
}
$('html').addClass(getTestClasses(features));
}
, flashVideoFallback: function (){
@ -244,7 +255,7 @@ var octopress = (function(){
$(document).ready(function() {
octopress.wrapFlashVideos();
octopress.testFeatures();
octopress.testFeature(['maskImage', 'transform']);
octopress.flashVideoFallback();
octopress.addCodeLineNumbers();
octopress.addMobileNav();