equal
deleted
inserted
replaced
1 <script src="../{{ site.jquery_js }}"></script> |
|
2 <script src="../{{ site.isotope_js }}"></script> |
|
3 <script src="../js/fake-element.js"></script> |
|
4 <script> |
|
5 $(function(){ |
|
6 |
|
7 var $container = $('#container'); |
|
8 |
|
9 {% include random-sizes.js %} |
|
10 |
|
11 $container.isotope({ |
|
12 itemSelector : '.element', |
|
13 masonry : { |
|
14 columnWidth : 120 |
|
15 }, |
|
16 masonryHorizontal : { |
|
17 rowHeight: 120 |
|
18 }, |
|
19 cellsByRow : { |
|
20 columnWidth : 240, |
|
21 rowHeight : 240 |
|
22 }, |
|
23 cellsByColumn : { |
|
24 columnWidth : 240, |
|
25 rowHeight : 240 |
|
26 }, |
|
27 getSortData : { |
|
28 symbol : function( $elem ) { |
|
29 return $elem.attr('data-symbol'); |
|
30 }, |
|
31 category : function( $elem ) { |
|
32 return $elem.attr('data-category'); |
|
33 }, |
|
34 number : function( $elem ) { |
|
35 return parseInt( $elem.find('.number').text(), 10 ); |
|
36 }, |
|
37 weight : function( $elem ) { |
|
38 return parseFloat( $elem.find('.weight').text().replace( /[\(\)]/g, '') ); |
|
39 }, |
|
40 name : function ( $elem ) { |
|
41 return $elem.find('.name').text(); |
|
42 } |
|
43 } |
|
44 }); |
|
45 |
|
46 {% include option-set-buttons.js %} |
|
47 |
|
48 {% include layout-change.js %} |
|
49 |
|
50 {% include change-sizes.js %} |
|
51 |
|
52 {% include add-buttons.js %} |
|
53 |
|
54 var $sortBy = $('#sort-by'); |
|
55 $('#shuffle a').click(function(){ |
|
56 $container.isotope('shuffle'); |
|
57 $sortBy.find('.selected').removeClass('selected'); |
|
58 $sortBy.find('[data-option-value="random"]').addClass('selected'); |
|
59 return false; |
|
60 }); |
|
61 |
|
62 |
|
63 }); |
|
64 </script> |
|