Vulcan/client/views/posts/posts_list.js

25 lines
637 B
JavaScript
Raw Normal View History

2014-07-05 11:24:28 +09:00
Template[getTemplate('posts_list')].helpers({
2014-07-05 11:42:28 +09:00
post_item: function () {
return getTemplate('post_item');
},
2013-10-29 16:55:59 +09:00
posts : function () {
2014-05-01 13:10:34 -07:00
if(this.postsList){ // XXX
this.postsList.rewind();
var posts = this.postsList.map(function (post, index, cursor) {
post.rank = index;
return post;
});
return posts;
}
2013-10-29 16:55:59 +09:00
},
2014-08-28 10:16:17 +09:00
postsLoadMore: function () {
return getTemplate('postsLoadMore');
},
postsListIncoming: function () {
return getTemplate('postsListIncoming');
}
});
Template[getTemplate('posts_list')].created = function() {
Session.set('listPopulatedAt', new Date());
};