Browse Source

keep initial mode options

pull/563/head
David DeSandro 11 years ago
parent
commit
1b35d6b410
  1. 13
      examples/masonry.html
  2. 3
      isotope.js

13
examples/masonry.html

@ -168,18 +168,6 @@ docReady( function() {
columnWidth: 120
},
getSortData: {
// number: function( itemElem ) {
// return parseInt( getText( itemElem.querySelector('.number') ), 10 );
// },
// symbol: function( itemElem ) {
// return getText( itemElem.querySelector('.symbol') );
// },
// name: function( itemElem ) {
// return getText( itemElem.querySelector('.name') );
// },
// category: function( itemElem ) {
// return itemElem.getAttribute('data-category');
// },
number: '.number parseInt',
symbol: '.symbol',
@ -191,7 +179,6 @@ docReady( function() {
return parseFloat( getText( itemElem.querySelector('.weight') ).replace( /[\(\)]/g, '') );
}
}
});

3
isotope.js

@ -73,8 +73,9 @@ function isotopeDefinition( Outlayer, getSize, matchesSelector, Item, layoutMode
var LayoutMode = layoutMode.modes[ name ];
// set mode options
// HACK extend initial options, back-fill in default options
var initialOpts = this.options[ name ] || {};
this.options[ name ] = LayoutMode.options ?
extend( LayoutMode.options, this.options[ name ] || {} ) : {};
extend( LayoutMode.options, initialOpts ) : initialOpts;
// init layout mode instance
this.modes[ name ] = new LayoutMode( this );
};

Loading…
Cancel
Save