2015-04-13 14:52:03 +09:00
|
|
|
Template.notificationItem.helpers({
|
2012-10-08 11:23:12 +09:00
|
|
|
properties: function(){
|
2014-10-02 16:42:31 -04:00
|
|
|
return this.data;
|
2012-10-08 11:23:12 +09:00
|
|
|
},
|
2013-01-19 18:24:18 +09:00
|
|
|
notificationHTML: function(){
|
2014-10-02 16:42:31 -04:00
|
|
|
return this.message();
|
2012-10-08 11:23:12 +09:00
|
|
|
}
|
2012-10-05 10:23:38 +09:00
|
|
|
});
|
|
|
|
|
2015-04-13 14:52:03 +09:00
|
|
|
Template.notificationItem.events({
|
2012-10-05 10:23:38 +09:00
|
|
|
'click .action-link': function(event, instance){
|
2012-10-08 11:23:12 +09:00
|
|
|
var notificationId=instance.data._id;
|
2014-10-02 16:42:31 -04:00
|
|
|
Herald.collection.update(
|
2012-10-08 11:23:12 +09:00
|
|
|
{_id: notificationId},
|
|
|
|
{
|
|
|
|
$set:{
|
|
|
|
read: true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
function(error, result){
|
|
|
|
if(error){
|
|
|
|
console.log(error);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
2012-10-05 10:23:38 +09:00
|
|
|
}
|
2014-10-02 16:42:31 -04:00
|
|
|
});
|