make sure the user really wants to delete something…

This commit is contained in:
nilsding 2014-12-08 15:45:15 +01:00
parent c486c293ef
commit 2d8305095b
2 changed files with 38 additions and 36 deletions

View File

@ -1,4 +1,5 @@
$(document).on "click", "button[name=ab-destroy]", -> $(document).on "click", "button[name=ab-destroy]", ->
if confirm 'Are you sure?'
btn = $(this) btn = $(this)
btn.button "loading" btn.button "loading"
aid = btn[0].dataset.aId aid = btn[0].dataset.aId

View File

@ -27,6 +27,7 @@ $(document).on "click", "button[name=ib-answer]", ->
$("textarea[name=ib-answer][data-id=#{iid}]").removeAttr "readonly" $("textarea[name=ib-answer][data-id=#{iid}]").removeAttr "readonly"
$(document).on "click", "button[name=ib-destroy]", -> $(document).on "click", "button[name=ib-destroy]", ->
if confirm 'Are you sure?'
btn = $(this) btn = $(this)
btn.button "loading" btn.button "loading"
iid = btn[0].dataset.ibId iid = btn[0].dataset.ibId