Vulcan/client/views/posts/post_page.js
Sadi 2d9a779ec6 [fix] undefined title in posts
This fixes the undefined title, when you view your posts
2014-06-15 15:06:31 +03:00

24 lines
658 B
JavaScript

Template.post_page.helpers({
post: function () {
return Posts.findOne(this.postId);
},
body_formatted: function(){
var converter = new Markdown.Converter();
var html_body=converter.makeHtml(this.body);
return html_body.autoLink();
},
canComment: function(){
return canComment(Meteor.user());
}
});
Template.post_page.rendered = function(){
if((scrollToCommentId=Session.get('scrollToCommentId')) && !this.rendered && $('#'+scrollToCommentId).exists()){
scrollPageTo('#'+scrollToCommentId);
Session.set('scrollToCommentId', null);
this.rendered=true;
}
document.title = $(".post-title").text();
}