Add mailbox delete ui

This commit is contained in:
Johannes Zellner
2018-04-05 21:22:07 +02:00
parent 01bfd84853
commit b0c4021d17
2 changed files with 43 additions and 1 deletions

View File

@@ -150,6 +150,31 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
}
},
remove: {
busy: false,
mailbox: null,
show: function (mailbox) {
$scope.mailboxes.remove.mailbox = mailbox;
$('#mailboxRemoveModal').modal('show');
},
submit: function () {
$scope.mailboxes.remove.busy = true;
Client.removeMailbox($scope.selectedDomain.domain, $scope.mailboxes.remove.mailbox.name, function (error) {
$scope.mailboxes.remove.busy = false;
if (error) return console.error(error);
$scope.mailboxes.remove.mailbox = null;
$scope.mailboxes.refresh();
$('#mailboxRemoveModal').modal('hide');
});
}
},
refresh: function () {
Client.getMailboxes($scope.selectedDomain.domain, function (error, mailboxes) {
if (error) return console.error(error);