Browse Source

move isNewProp to top,

pull/14/head
David DeSandro 15 years ago
parent
commit
78058c77f1
  1. 28
      src/jquery.molequul.js

28
src/jquery.molequul.js

@ -31,6 +31,15 @@
usingTransforms : Modernizr.csstransforms && Modernizr.csstransitions, usingTransforms : Modernizr.csstransforms && Modernizr.csstransitions,
isNewProp : function( property, props ) {
if ( !props.initialized ) {
return true;
}
var previousProp = props.prevOpts[ property ];
return ( props.opts[ property ] !== previousProp );
},
// ====================== Filtering ======================
filter : function( $cards ) { filter : function( $cards ) {
var props = this.data('molequul'), var props = this.data('molequul'),
@ -82,15 +91,6 @@
}); });
}, },
isNewProp : function( property, props ) {
if ( !props.initialized ) {
return true;
}
var previousProp = props.prevOpts[ property ] ?
props.prevOpts[ property ] : undefined;
return ( props.opts[ property ] !== previousProp );
},
getSortFn : function( sortBy, sortDir ) { getSortFn : function( sortBy, sortDir ) {
var getSorter = function( elem ) { var getSorter = function( elem ) {
return $(elem).data('molequul-sort-data')[ sortBy ]; return $(elem).data('molequul-sort-data')[ sortBy ];
@ -98,7 +98,7 @@
return function( alpha, beta ) { return function( alpha, beta ) {
var a = getSorter( alpha ), var a = getSorter( alpha ),
b = getSorter( beta ); b = getSorter( beta );
return ( a > b ) ? 1 * sortDir : ( a < b ) ? -1 * sortDir : 0; return ( ( a > b ) ? 1 : ( a < b ) ? -1 : 0 ) * sortDir;
} }
}, },
@ -297,6 +297,7 @@
.molequul( 'layout', props.atoms.$filtered ); .molequul( 'layout', props.atoms.$filtered );
}, },
// ====================== General Methods ====================== // ====================== General Methods ======================
@ -355,15 +356,9 @@
// or anyone else's crazy jquery fun // or anyone else's crazy jquery fun
this.data( 'molequul', props ); this.data( 'molequul', props );
return this; return this;
}, },
resize : function() { resize : function() {
var props = this.data('molequul'); var props = this.data('molequul');
props.initialized = true; props.initialized = true;
@ -533,7 +528,6 @@
return $.molequul.init.apply( this, arguments ); return $.molequul.init.apply( this, arguments );
} }
}; };

Loading…
Cancel
Save