Browse Source

src : refactor _updateOption into option method

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

16
jquery.isotope.js

@ -446,8 +446,14 @@
// signature: $('#foo').bar({ cool:false }); // signature: $('#foo').bar({ cool:false });
if ( $.isPlainObject( opts ) ){ if ( $.isPlainObject( opts ) ){
this.options = $.extend( true, this.options, opts ); this.options = $.extend( true, this.options, opts );
// trigger _updateOptionName if it exists
var updateOptionFn;
for ( var optionName in opts ) { for ( var optionName in opts ) {
this._updateOption( optionName ); updateOptionFn = '_update' + capitalize( optionName );
if ( this[ updateOptionFn ] ) {
this[ updateOptionFn ]();
}
} }
} }
}, },
@ -455,14 +461,6 @@
// ====================== updaters ====================== // // ====================== updaters ====================== //
// kind of like setters // kind of like setters
// trigger _updateOptionName if it exists
_updateOption : function( optionName ) {
var updateOptionFn = '_update' + capitalize( optionName );
if ( this[ updateOptionFn ] ) {
this[ updateOptionFn ]();
}
},
_updateAnimationEngine : function() { _updateAnimationEngine : function() {
var animationEngine = this.options.animationEngine.toLowerCase().replace( /[ _\-]/g, ''); var animationEngine = this.options.animationEngine.toLowerCase().replace( /[ _\-]/g, '');
// set applyStyleFnName // set applyStyleFnName

2
jquery.isotope.min.js vendored

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