Browse Source

src : miniModernizr : refactor for jQuery

pull/96/head
David DeSandro 14 years ago
parent
commit
2bea6b58f4
  1. 32
      jquery.isotope.js
  2. 2
      jquery.isotope.min.js

32
jquery.isotope.js

@ -83,22 +83,18 @@
var test = !!getStyleProperty('perspective');
// double check for Chrome's false positive
if ( test ) {
var st = document.createElement('style'),
div = document.createElement('div'),
vendorCSSPrefixes = ' -o- -moz- -ms- -webkit- -khtml- '.split(' '),
mq = '@media (' + vendorCSSPrefixes.join('transform-3d),(') + 'modernizr)';
var vendorCSSPrefixes = ' -o- -moz- -ms- -webkit- -khtml- '.split(' '),
mediaQuery = '@media (' + vendorCSSPrefixes.join('transform-3d),(') + 'modernizr)',
$style = $('<style>' + mediaQuery + '{#modernizr{height:3px}}' + '</style>')
.appendTo('head'),
$div = $('<div id="modernizr" />').appendTo('html');
st.textContent = mq + '{#modernizr{height:3px}}';
(document.head || document.getElementsByTagName('head')[0]).appendChild(st);
div.id = 'modernizr';
docElement.appendChild(div);
test = $div.height() === 3;
test = div.offsetHeight === 3;
st.parentNode.removeChild(st);
div.parentNode.removeChild(div);
$div.remove();
$style.remove();
}
return !!test;
return test;
}
},
{
@ -128,20 +124,20 @@
var miniModernizr = {
_version : '1.6ish: miniModernizr for Isotope'
},
classes = [],
test, result, className;
classes = ' ',
test, result,
className;
// Run through tests
for ( i=0; i < len; i++ ) {
test = tests[i];
result = test.getResult();
miniModernizr[ test.name ] = result;
className = ( result ? '' : 'no-' ) + test.name;
classes.push( className );
classes += ' ' + ( result ? '' : 'no-' ) + test.name;
}
// Add the new classes to the <html> element.
docElement.className += ' ' + classes.join( ' ' );
$('html').addClass( classes );
return miniModernizr;
})();

2
jquery.isotope.min.js vendored

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save