Vulcan/client/views/posts/post_item.js
2015-04-13 16:29:33 +09:00

30 lines
751 B
JavaScript

var post = {};
Template.post_item.created = function () {
post = this.data;
};
Template.post_item.helpers({
postModules: function () {
return postModules;
},
moduleContext: function () { // not used for now
var module = this;
module.templateClass = camelToDash(this.template) + ' ' + this.position + ' cell';
module.post = post;
return module;
},
moduleClass: function () {
return camelToDash(this.template) + ' post-module';
},
postClass: function () {
var post = this;
var postAuthorClass = "author-"+post.author;
var postClass = postClassCallbacks.reduce(function(result, currentFunction) {
return currentFunction(post, result);
}, postAuthorClass);
return postClass;
}
});