From 5f3f4ef74ed9869868583afd157512d409f992b4 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Mon, 3 Nov 2014 15:37:25 -0500 Subject: [PATCH] closes #2266 --- public/src/admin/manage/flags.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/public/src/admin/manage/flags.js b/public/src/admin/manage/flags.js index 1aac607746..8a07ba03af 100644 --- a/public/src/admin/manage/flags.js +++ b/public/src/admin/manage/flags.js @@ -1,5 +1,5 @@ "use strict"; -/*global define, socket, app, admin, utils, RELATIVE_PATH*/ +/*global define, socket, app, admin, utils, bootbox, RELATIVE_PATH*/ define('admin/manage/flags', ['forum/infinitescroll', 'admin/modules/selectable'], function(infinitescroll, selectable) { var Flags = {}; @@ -25,10 +25,15 @@ define('admin/manage/flags', ['forum/infinitescroll', 'admin/modules/selectable' function handleDelete() { $('.flags').on('click', '.delete', function() { var btn = $(this); - var pid = btn.siblings('[data-pid]').attr('data-pid'); - var tid = btn.siblings('[data-pid]').attr('data-tid'); - socket.emit('posts.delete', {pid: pid, tid: tid}, function(err) { - done(err, btn); + bootbox.confirm('Do you really want to delete this post?', function(confirm) { + if(!confirm) { + return; + } + var pid = btn.siblings('[data-pid]').attr('data-pid'); + var tid = btn.siblings('[data-pid]').attr('data-tid'); + socket.emit('posts.delete', {pid: pid, tid: tid}, function(err) { + done(err, btn); + }); }); }); }