Vulcan/client/views/posts/post_list/posts_list.js
2015-01-06 14:46:20 +09:00

34 lines
No EOL
932 B
JavaScript

Template[getTemplate('posts_list')].created = function() {
Session.set('listPopulatedAt', new Date());
};
Template[getTemplate('posts_list')].helpers({
description: function () {
var controller = Iron.controller();
if (typeof controller.getDescription === 'function')
return Iron.controller().getDescription();
},
before_post_item: function () {
return getTemplate('before_post_item');
},
post_item: function () {
return getTemplate('post_item');
},
after_post_item: function () {
return getTemplate('after_post_item');
},
posts : function () {
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');
}
});