From 8040b07c2876a9055332c60a88f5f677ac85528d Mon Sep 17 00:00:00 2001 From: Carlos Tadeu Panato Junior Date: Mon, 18 Dec 2017 05:36:14 +0100 Subject: [PATCH] Button to delete the mailbox from the UI (#65), closes #55 --- themes/bootstrap/public/mailbox.js | 13 +++++++++++++ themes/bootstrap/templates/mailbox/index.html | 8 ++++++++ 2 files changed, 21 insertions(+) diff --git a/themes/bootstrap/public/mailbox.js b/themes/bootstrap/public/mailbox.js index f7e229a..3b26a99 100644 --- a/themes/bootstrap/public/mailbox.js +++ b/themes/bootstrap/public/mailbox.js @@ -22,6 +22,19 @@ function deleteMessage(id) { }) } +// Delete the mailbox +function deleteMailBox() { + cont = confirm("Are you sure you want delete the Mailbox?") + if (cont == false) { + return; + } + $.ajax({ + type: 'DELETE', + url: '/api/v1/mailbox/' + mailbox, + success: loadList + }) +} + // flashTooltip temporarily changes the text of a tooltip function flashTooltip(el, text) { var prevText = $(el).attr('data-original-title'); diff --git a/themes/bootstrap/templates/mailbox/index.html b/themes/bootstrap/templates/mailbox/index.html index 3af855e..8103bac 100644 --- a/themes/bootstrap/templates/mailbox/index.html +++ b/themes/bootstrap/templates/mailbox/index.html @@ -57,6 +57,14 @@ $(document).ready(function() { onclick="loadList()"> +