Vulcan/packages/telescope-notifications/lib/client/templates/notification_item.js

28 lines
531 B
JavaScript
Raw Normal View History

2014-08-20 17:03:54 +09:00
Template[getTemplate('notificationItem')].helpers({
properties: function(){
2014-10-02 16:42:31 -04:00
return this.data;
},
notificationHTML: function(){
2014-10-02 16:42:31 -04:00
return this.message();
}
});
2014-08-20 17:03:54 +09:00
Template[getTemplate('notificationItem')].events({
'click .action-link': function(event, instance){
var notificationId=instance.data._id;
2014-10-02 16:42:31 -04:00
Herald.collection.update(
{_id: notificationId},
{
$set:{
read: true
}
},
function(error, result){
if(error){
console.log(error);
}
}
);
}
2014-10-02 16:42:31 -04:00
});