This commit is contained in:
psychobunny
2014-02-04 11:50:50 -05:00
parent cecd3fe969
commit 3c63b135c7

View File

@@ -443,13 +443,17 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
});
$('#post-container').on('click', '.flag', function() {
var pid = $(this).parents('.post-row').attr('data-pid');
bootbox.confirm('Are you sure you want to flag this post?', function(confirm) {
if (confirm) {
var pid = $(this).parents('.post-row').attr('data-pid');
socket.emit('posts.flag', pid, function(err) {
if(err) {
return app.alertError(err.message);
socket.emit('posts.flag', pid, function(err) {
if(err) {
return app.alertError(err.message);
}
app.alertSuccess('This post has been flagged for moderation.');
});
}
app.alertSuccess('This post has been flagged for moderation.');
});
});