diff --git a/examples/masonry.html b/examples/masonry.html index 87692d3..7d164cd 100644 --- a/examples/masonry.html +++ b/examples/masonry.html @@ -26,14 +26,12 @@

Sort

- + + + + +
@@ -174,7 +172,7 @@ docReady( function() { masonry: { columnWidth: 90 }, - // itemSelector: '.element', + itemSelector: '.element', stamp: '.stamp', getSortData: { @@ -194,16 +192,11 @@ docReady( function() { var options = document.querySelector('#options'); eventie.bind( options, 'click', function( event ) { - if ( !matchesSelector( event.target, 'a' ) ) { + if ( !matchesSelector( event.target, 'button' ) ) { return; } - - // use link's href, remove leading hash - var sortBy = event.target.getAttribute('href').slice( 1 ); - sortBy.slice( 0, 1 ); - iso.options.sortBy = sortBy; - iso.arrange(); - event.preventDefault(); + var sortBy = event.target.getAttribute('data-sort-by'); + iso.arrange({ sortBy: sortBy }); }); });