Vulcan/client/views/posts/posts_list.js
2014-09-16 15:29:11 +10:00

25 lines
No EOL
637 B
JavaScript

Template[getTemplate('posts_list')].helpers({
post_item: function () {
return getTemplate('post_item');
},
posts : function () {
if(this.postsList){ // XXX
this.postsList.rewind();
var posts = this.postsList.map(function (post, index, cursor) {
post.rank = index;
return post;
});
return posts;
}
},
postsLoadMore: function () {
return getTemplate('postsLoadMore');
},
postsListIncoming: function () {
return getTemplate('postsListIncoming');
}
});
Template[getTemplate('posts_list')].created = function() {
Session.set('listPopulatedAt', new Date());
};