From 1d38c91fbc8aed5b909c0ce9f60014b219fe792a Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 12 Dec 2017 19:08:52 +0100 Subject: delete and reply --- public/assets/js/lib/views/mail/mailbox.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'public/assets/js/lib/views/mail/mailbox.js') diff --git a/public/assets/js/lib/views/mail/mailbox.js b/public/assets/js/lib/views/mail/mailbox.js index 860d200..b7877f2 100644 --- a/public/assets/js/lib/views/mail/mailbox.js +++ b/public/assets/js/lib/views/mail/mailbox.js @@ -54,20 +54,23 @@ var MailboxView = View.extend({ .replace(/{{size_class}}/g, size[0] ) var $t = $(t) if (is_sender) { - $t.find('reply_link').remove() + $t.find('.reply_link').remove() } return $t }, discard: function(e){ var id = $(e.target).data('id') + var ok = confirm("Really delete this message?") + if (! ok) return $.ajax({ method: 'delete', url: '/api/message/' + id, + headers: { "csrf-token": csrf() }, + data: { _csrf: csrf() }, success: function(){ window.location.reload() }, error: function(){ window.location.reload() }, }) }, - }) -- cgit v1.2.3-70-g09d2