2015-05-18 10:12:48 +09:00
|
|
|
Template.notification_item.helpers({
|
2015-06-24 18:51:32 +09:00
|
|
|
showItem: function () {
|
|
|
|
try {
|
|
|
|
this.message();
|
|
|
|
return true;
|
|
|
|
} catch (e) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
},
|
2015-04-22 07:50:11 +09:00
|
|
|
properties: function(){
|
|
|
|
return this.data;
|
|
|
|
},
|
|
|
|
notificationHTML: function(){
|
|
|
|
return this.message();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2015-05-18 10:12:48 +09:00
|
|
|
Template.notification_item.events({
|
2015-04-22 07:50:11 +09:00
|
|
|
'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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|