Browse Source

masonry example fixes for IE8

pull/726/head
David DeSandro 11 years ago
parent
commit
4fb9583880
  1. 27
      examples/masonry.html

27
examples/masonry.html

@ -26,14 +26,12 @@
<div id="options"> <div id="options">
<h2>Sort</h2> <h2>Sort</h2>
<ul class="option-set"> <button data-sort-by="original-order">original-order</a></li>
<li><a href="#original-order">original-order</a></li> <button data-sort-by="number">number</button>
<li><a href="#number">number</a></li> <button data-sort-by="name">name</button>
<li><a href="#name">name</a></li> <button data-sort-by="symbol">symbol</button>
<li><a href="#symbol">symbol</a></li> <button data-sort-by="weight">weight</button>
<li><a href="#weight">weight</a></li> <button data-sort-by="category">category</button>
<li><a href="#category">category</a></li>
</ul>
</div> </div>
<div id="container"> <div id="container">
@ -174,7 +172,7 @@ docReady( function() {
masonry: { masonry: {
columnWidth: 90 columnWidth: 90
}, },
// itemSelector: '.element', itemSelector: '.element',
stamp: '.stamp', stamp: '.stamp',
getSortData: { getSortData: {
@ -194,16 +192,11 @@ docReady( function() {
var options = document.querySelector('#options'); var options = document.querySelector('#options');
eventie.bind( options, 'click', function( event ) { eventie.bind( options, 'click', function( event ) {
if ( !matchesSelector( event.target, 'a' ) ) { if ( !matchesSelector( event.target, 'button' ) ) {
return; return;
} }
var sortBy = event.target.getAttribute('data-sort-by');
// use link's href, remove leading hash iso.arrange({ sortBy: sortBy });
var sortBy = event.target.getAttribute('href').slice( 1 );
sortBy.slice( 0, 1 );
iso.options.sortBy = sortBy;
iso.arrange();
event.preventDefault();
}); });
}); });

Loading…
Cancel
Save