From: Charles Connell Date: Thu, 2 Jan 2014 18:04:09 +0000 (-0500) Subject: Confirm note flagging X-Git-Tag: release-20150131~334 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0e01704f83df13e87a374ea918c2e6ef579dbc5f;p=oweals%2Fkarmaworld.git Confirm note flagging --- diff --git a/karmaworld/assets/js/note-detail.js b/karmaworld/assets/js/note-detail.js index a5d175c..14d3a58 100644 --- a/karmaworld/assets/js/note-detail.js +++ b/karmaworld/assets/js/note-detail.js @@ -63,7 +63,7 @@ function setupPdfViewer() { } $(function() { - $("#thank-button").click(function() { + $("#thank-button").click(function(event) { event.preventDefault(); // increment number in page right away @@ -85,21 +85,23 @@ $(function() { }); }); - $("#flag-button").click(function() { + $("#flag-button").click(function(event) { event.preventDefault(); - // disable thank button so it can't - // be pressed again - $(this).hide(); - $('#flag-button-disabled').show(); - $(this).unbind('click'); - - // tell server that somebody thanked - // this note - $.ajax({ - url: note_flag_url, - dataType: "json", - type: 'POST' - }); + if (confirm('Do you wish to flag this note for deletion?')) { + // disable thank button so it can't + // be pressed again + $(this).hide(); + $('#flag-button-disabled').show(); + $(this).unbind('click'); + + // tell server that somebody thanked + // this note + $.ajax({ + url: note_flag_url, + dataType: "json", + type: 'POST' + }); + } }); });