Vulcan/packages/telescope-notifications/lib/client/templates/notification_item.js
2015-06-24 18:51:32 +09:00

35 lines
627 B
JavaScript

Template.notification_item.helpers({
showItem: function () {
try {
this.message();
return true;
} catch (e) {
return false;
}
},
properties: function(){
return this.data;
},
notificationHTML: function(){
return this.message();
}
});
Template.notification_item.events({
'click .action-link': function(event, instance){
var notificationId=instance.data._id;
Herald.collection.update(
{_id: notificationId},
{
$set:{
read: true
}
},
function(error, result){
if(error){
console.log(error);
}
}
);
}
});