Vulcan/client/views/nav/notification_item.js

30 lines
620 B
JavaScript
Raw Normal View History

2014-08-20 17:03:54 +09:00
Template[getTemplate('notificationItem')].helpers({
nice_time: function(){
return moment(this.timestamp).fromNow();
},
properties: function(){
return this.properties;
},
notificationHTML: function(){
2014-08-03 11:50:10 +09:00
return buildSiteNotification(this);
}
});
2014-08-20 17:03:54 +09:00
Template[getTemplate('notificationItem')].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);
}
}
);
}
2012-10-04 13:30:57 +09:00
});