1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-17 17:47:03 +00:00

Button to delete the mailbox from the UI (#65), closes #55

This commit is contained in:
Carlos Tadeu Panato Junior
2017-12-18 05:36:14 +01:00
committed by James Hillyerd
parent 4e8c287608
commit 8040b07c28
2 changed files with 21 additions and 0 deletions

View File

@@ -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');

View File

@@ -57,6 +57,14 @@ $(document).ready(function() {
onclick="loadList()">
<span class="glyphicon glyphicon-refresh" aria-hidden="true"></span>
</button>
<button class="btn btn-default"
type="button"
data-toggle="tooltip"
data-placement="top"
title="Delete&nbsp;Mailbox"
onclick="deleteMailBox()">
<span class="glyphicon glyphicon-remove"></span>
</button>
</div>
</div>
<div id="message-list-wrapper">