From 1449d438f50b6ca420cc629a601155802f4344d4 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Sat, 19 Dec 2015 20:41:56 +0200 Subject: [PATCH] closes #3969 --- public/src/admin/manage/flags.js | 10 +++++----- src/views/admin/manage/flags.tpl | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/public/src/admin/manage/flags.js b/public/src/admin/manage/flags.js index b76ccf1708..12d390789d 100644 --- a/public/src/admin/manage/flags.js +++ b/public/src/admin/manage/flags.js @@ -25,7 +25,7 @@ define('admin/manage/flags', [ function handleDismiss() { $('.flags').on('click', '.dismiss', function() { var btn = $(this); - var pid = btn.siblings('[data-pid]').attr('data-pid'); + var pid = btn.parents('[data-pid]').attr('data-pid'); socket.emit('admin.dismissFlag', pid, function(err) { done(err, btn); @@ -49,11 +49,11 @@ define('admin/manage/flags', [ $('.flags').on('click', '.delete', function() { var btn = $(this); bootbox.confirm('Do you really want to delete this post?', function(confirm) { - if(!confirm) { + if (!confirm) { return; } - var pid = btn.siblings('[data-pid]').attr('data-pid'); - var tid = btn.siblings('[data-pid]').attr('data-tid'); + var pid = btn.parents('[data-pid]').attr('data-pid'); + var tid = btn.parents('[data-pid]').attr('data-tid'); socket.emit('posts.delete', {pid: pid, tid: tid}, function(err) { done(err, btn); }); @@ -65,7 +65,7 @@ define('admin/manage/flags', [ if (err) { return app.alertError(err.messaage); } - btn.parent().fadeOut(function() { + btn.parents('[data-pid]').fadeOut(function() { $(this).remove(); if (!$('.flags [data-pid]').length) { $('.post-container').text('No flagged posts!'); diff --git a/src/views/admin/manage/flags.tpl b/src/views/admin/manage/flags.tpl index c66bc2573a..6370630c20 100644 --- a/src/views/admin/manage/flags.tpl +++ b/src/views/admin/manage/flags.tpl @@ -36,9 +36,9 @@ -
+
-
+