From 9078a0ce5134360e11159f879b2adefc6bef05c7 Mon Sep 17 00:00:00 2001 From: Felix Hammerl Date: Mon, 11 Nov 2013 15:53:34 +0100 Subject: [PATCH] [WO-84] confirm deletion from trash --- src/js/controller/mail-list.js | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/src/js/controller/mail-list.js b/src/js/controller/mail-list.js index b9bcec5..eaf1f06 100644 --- a/src/js/controller/mail-list.js +++ b/src/js/controller/mail-list.js @@ -103,7 +103,31 @@ define(function(require) { return; } - var index; + var index, trashFolder; + + trashFolder = _.findWhere($scope.folders, { + type: 'Trash' + }); + + if (getFolder() === trashFolder) { + $scope.state.dialog = { + open: true, + title: 'Remove permanently?', + message: 'Do you want to remove this message permanently?', + callback: function(ok) { + $scope.state.dialog.open = false; + + if (!ok) { + return; + } + + removeLocalAndShowNext(); + removeRemote(); + } + }; + return; + } + removeLocalAndShowNext(); removeRemote(); @@ -123,9 +147,6 @@ define(function(require) { } function removeRemote() { - var trashFolder = _.findWhere($scope.folders, { - type: 'Trash' - }); if (getFolder() === trashFolder) { emailDao.imapDeleteMessage({ folder: getFolder().path,