fix email record list

This commit is contained in:
yuri
2015-03-16 10:25:10 +02:00
parent 843ca2a7c5
commit aeea86155c
2 changed files with 23 additions and 22 deletions
@@ -53,5 +53,8 @@
"sent": "Sent",
"archived": "Archived",
"draft": "Draft"
},
"massActions": {
"markAsRead": "Mark As Read"
}
}
+20 -22
View File
@@ -28,29 +28,27 @@ Espo.define('Views.Email.Record.List', 'Views.Record.List', function (Dep) {
setup: function () {
Dep.prototype.setup.call(this);
this.actions.push({
name: 'markAsRead',
label: 'Mark Read',
action: function (e) {
var ids = [];
for (var i in this.checkedList) {
ids.push(this.checkedList[i]);
}
$.ajax({
url: 'Email/action/markAsRead',
type: 'POST',
data: JSON.stringify({
ids: ids
})
});
ids.forEach(function (id) {
var model = this.collection.get(id);
if (model) {
model.set('isRead', true);
}
}, this);
}.bind(this)
this.massActionList.push('markAsRead');
},
massActionMarkAsRead: function () {
var ids = [];
for (var i in this.checkedList) {
ids.push(this.checkedList[i]);
}
$.ajax({
url: 'Email/action/markAsRead',
type: 'POST',
data: JSON.stringify({
ids: ids
})
});
ids.forEach(function (id) {
var model = this.collection.get(id);
if (model) {
model.set('isRead', true);
}
}, this);
},
});