diff options
Diffstat (limited to 'web-ui/app/js/services/mail_service.js')
-rw-r--r-- | web-ui/app/js/services/mail_service.js | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/web-ui/app/js/services/mail_service.js b/web-ui/app/js/services/mail_service.js index 6a42d920..a63d517e 100644 --- a/web-ui/app/js/services/mail_service.js +++ b/web-ui/app/js/services/mail_service.js @@ -137,11 +137,23 @@ define( return _.bind(function (response) { this.refreshMails(); this.trigger(document, events.ui.userAlerts.displayMessage, { message: i18n(response.successMessage)}); - //this.trigger(document, events.ui.userAlerts.displayMessage, { message: i18n("Your message was archived")}); this.trigger(document, events.ui.mails.uncheckAll); }, this); }; + this.archiveManyMails = function(event, dataToArchive) { + var mailIdents = _.map(dataToArchive.checkedMails, function (mail) { + return mail.ident; + }); + monitoredAjax(this, '/mails/archive', { + type: 'POST', + dataType: 'json', + contentType: 'application/json; charset=utf-8', + data: JSON.stringify({idents: mailIdents}) + }).done(this.triggerArchived(dataToArchive)) + .fail(this.errorMessage(i18n('Could not archive emails'))); + }; + this.deleteMail = function (ev, data) { monitoredAjax(this, '/mail/' + data.mail.ident, {type: 'DELETE'}) @@ -179,20 +191,6 @@ define( .fail(this.errorMessage(i18n('Could not move emails to inbox'))); }; - this.archiveManyMails = function(event, dataToArchive) { - var mailIdents = _.map(dataToArchive.checkedMails, function (mail) { - return mail.ident; - }); - - monitoredAjax(this, '/mails/archive', { - type: 'POST', - dataType: 'json', - contentType: 'application/json; charset=utf-8', - data: JSON.stringify({idents: mailIdents}) - }).done(this.triggerArchived(dataToArchive)) - .fail(this.errorMessage(i18n('Could not archive emails'))); - } - function compileQuery(data) { var query = 'tag:"' + that.attr.currentTag + '"'; |