Browse Source

src : jsHinted; remove getStyleProperty from closure; jsHint comment;

pull/96/head
David DeSandro 14 years ago
parent
commit
60dba42f1f
  1. 34
      jquery.isotope.js
  2. 5
      jquery.isotope.min.js

34
jquery.isotope.js

@ -1,5 +1,5 @@
/** /**
* Isotope v1.3.110604 * Isotope v1.3.110620
* An exquisite jQuery plugin for magical layouts * An exquisite jQuery plugin for magical layouts
* http://isotope.metafizzy.co * http://isotope.metafizzy.co
* *
@ -9,40 +9,42 @@
* Copyright 2011 David DeSandro / Metafizzy * Copyright 2011 David DeSandro / Metafizzy
*/ */
/*global Modernizr: true */
(function( window, $, undefined ){ (function( window, $, undefined ){
// helper function
function capitalize(str) {
return str.charAt(0).toUpperCase() + str.slice(1);
}
// ========================= getStyleProperty by kangax =============================== // ========================= getStyleProperty by kangax ===============================
// http://perfectionkills.com/feature-testing-css-properties/ // http://perfectionkills.com/feature-testing-css-properties/
var getStyleProperty = (function(){ var prefixes = 'Moz Webkit Khtml O Ms'.split(' ');
var prefixes = ['Moz', 'Webkit', 'Khtml', 'O', 'Ms'];
function getStyleProperty(propName, element) { function getStyleProperty( propName, element ) {
element = element || document.documentElement; element = element || document.documentElement;
var style = element.style, var style = element.style,
prefixed; prefixed;
// test standard property first // test standard property first
if (typeof style[propName] === 'string') { if ( typeof style[propName] === 'string' ) {
return propName; return propName;
} }
// capitalize // capitalize
propName = propName.charAt(0).toUpperCase() + propName.slice(1); propName = capitalize( propName );
// test vendor specific properties // test vendor specific properties
for (var i=0, l=prefixes.length; i<l; i++) { for ( var i=0, len = prefixes.length; i < len; i++ ) {
prefixed = prefixes[i] + propName; prefixed = prefixes[i] + propName;
if (typeof style[prefixed] === 'string') { if ( typeof style[ prefixed ] === 'string' ) {
return prefixed; return prefixed;
} }
} }
} }
return getStyleProperty;
})();
var transformProp = getStyleProperty('transform'); var transformProp = getStyleProperty('transform');
// ========================= miniModernizr =============================== // ========================= miniModernizr ===============================
@ -68,7 +70,6 @@
*/ */
var docElement = document.documentElement, var docElement = document.documentElement,
vendorCSSPrefixes = ' -o- -moz- -ms- -webkit- -khtml- '.split(' '),
tests = [ tests = [
{ {
name : 'csstransforms', name : 'csstransforms',
@ -84,6 +85,7 @@
if ( test ){ if ( test ){
var st = document.createElement('style'), var st = document.createElement('style'),
div = document.createElement('div'), div = document.createElement('div'),
vendorCSSPrefixes = ' -o- -moz- -ms- -webkit- -khtml- '.split(' '),
mq = '@media (' + vendorCSSPrefixes.join('transform-3d),(') + 'modernizr)'; mq = '@media (' + vendorCSSPrefixes.join('transform-3d),(') + 'modernizr)';
st.textContent = mq + '{#modernizr{height:3px}}'; st.textContent = mq + '{#modernizr{height:3px}}';
@ -452,7 +454,7 @@
// trigger _updateOptionName if it exists // trigger _updateOptionName if it exists
_updateOption : function( optionName ) { _updateOption : function( optionName ) {
var updateOptionFn = '_update' + optionName.charAt(0).toUpperCase() + optionName.slice(1); var updateOptionFn = '_update' + capitalize( optionName );
if ( this[ updateOptionFn ] ) { if ( this[ updateOptionFn ] ) {
this[ updateOptionFn ](); this[ updateOptionFn ]();
} }
@ -856,7 +858,7 @@
} }
// position the brick // position the brick
x = this.masonry.columnWidth * shortCol; var x = this.masonry.columnWidth * shortCol,
y = minimumY; y = minimumY;
this._pushPosition( $brick, x, y ); this._pushPosition( $brick, x, y );
@ -1042,7 +1044,7 @@
} }
// position the brick // position the brick
x = minimumX; var x = minimumX,
y = this.masonryHorizontal.rowHeight * smallRow; y = this.masonryHorizontal.rowHeight * smallRow;
this._pushPosition( $brick, x, y ); this._pushPosition( $brick, x, y );

5
jquery.isotope.min.js vendored

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