From 78058c77f1f081bf685a60bc1f7ae396b55b1679 Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Sat, 16 Oct 2010 16:52:00 -0400 Subject: [PATCH] move isNewProp to top, --- src/jquery.molequul.js | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/src/jquery.molequul.js b/src/jquery.molequul.js index 4867f32..f4cd330 100755 --- a/src/jquery.molequul.js +++ b/src/jquery.molequul.js @@ -31,6 +31,15 @@ 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 ) { 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 ) { var getSorter = function( elem ) { return $(elem).data('molequul-sort-data')[ sortBy ]; @@ -98,7 +98,7 @@ return function( alpha, beta ) { var a = getSorter( alpha ), 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 ); }, + // ====================== General Methods ====================== @@ -355,15 +356,9 @@ // or anyone else's crazy jquery fun this.data( 'molequul', props ); - - return this; - }, - - - resize : function() { var props = this.data('molequul'); props.initialized = true; @@ -533,7 +528,6 @@ return $.molequul.init.apply( this, arguments ); } - };