Browse Source

reference this.isotope in LayoutMode.layout

fixes bug where Masonry was not filter/sorting on layout after resize, after an insert
pull/726/head
David DeSandro 11 years ago
parent
commit
cc6741e3df
  1. 4
      examples/insert.html
  2. 7
      js/layout-mode.js

4
examples/insert.html

@ -34,11 +34,13 @@
<script src="../bower_components/matches-selector/matches-selector.js"></script>
<script src="../bower_components/outlayer/item.js"></script>
<script src="../bower_components/outlayer/outlayer.js"></script>
<script src="../bower_components/masonry/masonry.js"></script>
<script src="../js/item.js"></script>
<script src="../js/layout-mode.js"></script>
<script src="../js/isotope.js"></script>
<script src="../js/layout-modes/fit-rows.js"></script>
<script src="../js/layout-modes/masonry.js"></script>
<script>
@ -46,7 +48,7 @@ docReady( function() {
var container = document.querySelector('#container');
var iso = new Isotope( container, {
layoutMode: 'fitRows',
layoutMode: 'masonry',
getSortData: {
b: 'b parseInt'
},

7
js/layout-mode.js

@ -30,8 +30,7 @@ function layoutModeDefinition( getSize, Outlayer ) {
'_manageStamp',
'_getContainerSize',
'_getElementOffset',
'resize',
'layout'
'resize'
];
for ( var i=0, len = facadeMethods.length; i < len; i++ ) {
@ -100,6 +99,10 @@ function layoutModeDefinition( getSize, Outlayer ) {
// ----- methods that should reference isotope ----- //
LayoutMode.prototype.layout = function() {
this.isotope.layout.apply( this.isotope, arguments );
};
LayoutMode.prototype.getSize = function() {
this.isotope.getSize();
this.size = this.isotope.size;

Loading…
Cancel
Save