mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 10:01:40 -05:00
transformed window vars in Session vars
This commit is contained in:
parent
cf8a433b0c
commit
6c2589ab90
4 changed files with 4 additions and 9 deletions
|
@ -34,7 +34,7 @@
|
|||
Session.set('scrollToCommentId', commentId);
|
||||
|
||||
// XXX: should use the Session for these
|
||||
// on post page, we show the comment recursion
|
||||
// on post page, we show the comment tree
|
||||
Session.set('showChildComments',true);
|
||||
// reset the new comment time at each new request of the post page
|
||||
Session.set('newCommentTimestamp',new Date());
|
||||
|
@ -51,7 +51,6 @@
|
|||
Session.set('selectedCommentId', id);
|
||||
|
||||
// XXX: should use the Session for these
|
||||
Session.set('showChildComments',false);
|
||||
Session.set('newCommentTimestamp',new Date());
|
||||
|
||||
return 'comment_page';
|
||||
|
@ -61,7 +60,6 @@
|
|||
Session.set('selectedCommentId', id);
|
||||
|
||||
// XXX: should use the Session for these
|
||||
Session.set('showChildComments', false);
|
||||
Session.set('newCommentTimestamp',new Date());
|
||||
|
||||
return 'comment_reply';
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
commentIsNew=function(comment){
|
||||
var d=new Date(comment.submitted);
|
||||
var commentIsNew=d > window.newCommentTimestamp;
|
||||
// console.log("body: "+comment.body+" | comment submission date: "+d+" | newCommentTimestamp: "+window.newCommentTimestamp+" | isNew: "+commentIsNew);
|
||||
var commentIsNew=d > Session.get('newCommentTimestamp');
|
||||
// console.log("body: "+comment.body+" | comment submission date: "+d+" | newCommentTimestamp: "+Session.get('newCommentTimestamp')+" | isNew: "+commentIsNew);
|
||||
return commentIsNew;
|
||||
};
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@ Template.comment_page.post = function(){
|
|||
Template.comment_page.helpers({
|
||||
comment: function(){
|
||||
var comment = Comments.findOne(Session.get('selectedCommentId'));
|
||||
// Template.comment_page.showChildComments = false;
|
||||
return comment;
|
||||
}
|
||||
});
|
|
@ -22,6 +22,4 @@ Template.post_page.rendered = function(){
|
|||
Session.set('scrollToCommentId', null);
|
||||
this.rendered=true;
|
||||
}
|
||||
}
|
||||
|
||||
window.newCommentTimestamp=new Date();
|
||||
}
|
Loading…
Add table
Reference in a new issue