mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-16 05:44:53 +00:00
@@ -659,15 +659,16 @@
|
||||
};
|
||||
|
||||
/**
|
||||
* @function $emptyTrash
|
||||
* @function $empty
|
||||
* @memberof Mailbox.prototype
|
||||
* @desc Empty the Trash folder.
|
||||
* @returns a promise of the HTTP operation
|
||||
*/
|
||||
Mailbox.prototype.$emptyTrash = function() {
|
||||
var _this = this;
|
||||
Mailbox.prototype.$empty = function() {
|
||||
var _this = this,
|
||||
action = 'empty' + this.type[0].capitalize() + this.type.substring(1);
|
||||
|
||||
return Mailbox.$$resource.post(this.id, 'emptyTrash').then(function(data) {
|
||||
return Mailbox.$$resource.post(this.id, action).then(function(data) {
|
||||
// Remove all messages from the mailbox
|
||||
_this.$messages = _this.$visibleMessages = [];
|
||||
_this.uidsMap = {};
|
||||
|
||||
@@ -258,11 +258,19 @@
|
||||
});
|
||||
};
|
||||
|
||||
this.emptyJunkFolder = function() {
|
||||
return this.emptyFolder(l('Junk folder emptied'));
|
||||
};
|
||||
|
||||
this.emptyTrashFolder = function() {
|
||||
this.folder.$emptyTrash().then(function() {
|
||||
return this.emptyFolder(l('Trash emptied'));
|
||||
};
|
||||
|
||||
this.emptyFolder = function(successMsg) {
|
||||
this.folder.$empty().then(function() {
|
||||
$mdToast.show(
|
||||
$mdToast.simple()
|
||||
.textContent(l('Trash emptied'))
|
||||
.textContent(successMsg)
|
||||
.position('top right')
|
||||
.hideDelay(3000));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user