-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
50 lines (42 loc) · 1015 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Generated by CoffeeScript 1.3.3
var ViewModel, tile, vm,
_this = this;
ViewModel = (function() {
function ViewModel(num) {
var i;
this.contents = ko.observableArray((function() {
var _i, _results;
_results = [];
for (i = _i = 1; 1 <= num ? _i <= num : _i >= num; i = 1 <= num ? ++_i : --_i) {
_results.push({
name: i,
height: 20 + Math.random() * 100
});
}
return _results;
})());
}
ViewModel.prototype.load_more = function() {
var i, _i;
for (i = _i = 0; _i <= 10; i = ++_i) {
this.contents.push({
name: 'added',
height: 20 + Math.random() * 100
});
}
return tile.update();
};
return ViewModel;
})();
vm = new ViewModel(30);
tile = new Pinterest.Tile({
container: "#container_dom",
tile_width: 200,
get_tiles_handler: function() {
return $('div', $('#container_dom'));
}
});
$(document).ready(function() {
ko.applyBindings(vm);
return tile.start();
});