Vulcan/client/views/notifications/notification_item.js

30 lines
No EOL
612 B
JavaScript

Template.notification_item.helpers({
nice_time: function(){
return moment(this.timestamp).fromNow();
},
properties: function(){
return this.properties;
},
notificationHTML: function(){
return getNotification(this.event, this.properties).html;
}
});
Template.notification_item.events({
'click .action-link': function(event, instance){
var notificationId=instance.data._id;
Notifications.update(
{_id: notificationId},
{
$set:{
read: true
}
},
function(error, result){
if(error){
console.log(error);
}
}
);
}
});