Commit 117855ea by Mike Chen

confirm before deleting comment/thread

parent 5df5cf98
...@@ -226,9 +226,12 @@ initializeFollowThread = (thread) -> ...@@ -226,9 +226,12 @@ initializeFollowThread = (thread) ->
handleDelete = (elem) -> handleDelete = (elem) ->
if $content.hasClass("thread") if $content.hasClass("thread")
url = Discussion.urlFor('delete_thread', id) url = Discussion.urlFor('delete_thread', id)
c = confirm "Are you sure to delete thread \"" + $content.find("a.thread-title").text() + "\"?"
else else
url = Discussion.urlFor('delete_comment', id) url = Discussion.urlFor('delete_comment', id)
c = confirm "Are you sure to delete this comment? "
if c != true
return
Discussion.safeAjax Discussion.safeAjax
$elem: $(elem) $elem: $(elem)
url: url url: url
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment