Browse Source

src : refactor option method

pull/96/head
David DeSandro 14 years ago
parent
commit
7b5ded801e
  1. 10
      jquery.isotope.js
  2. 2
      jquery.isotope.min.js

10
jquery.isotope.js

@ -438,12 +438,12 @@
}, },
option: function( key, value ){ option : function( opts ){
// change options AFTER initialization: // change options AFTER initialization:
// signature: $('#foo').bar({ cool:false }); // signature: $('#foo').bar({ cool:false });
if ( $.isPlainObject( key ) ){ if ( $.isPlainObject( opts ) ){
this.options = $.extend(true, this.options, key); this.options = $.extend( true, this.options, opts );
for ( var optionName in key ) { for ( var optionName in opts ) {
this._updateOption( optionName ); this._updateOption( optionName );
} }
} }
@ -1244,7 +1244,7 @@
var instance = $.data( this, 'isotope' ); var instance = $.data( this, 'isotope' );
if ( instance ) { if ( instance ) {
// apply options & init // apply options & init
instance.option( options || {} ); instance.option( options );
instance._init(); instance._init();
} else { } else {
// initialize new instance // initialize new instance

2
jquery.isotope.min.js vendored

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