popup confirm before deleting

This commit is contained in:
Tyler Renelle
2012-02-15 11:45:42 -05:00
parent fbaf43361a
commit 66778409f5
@@ -18,11 +18,12 @@ class HabitTracker.Views.Habits.EditView extends Backbone.View
)
destroy: () ->
@model.destroy()
this.remove()
window.location.hash = "#"
return false
answer = confirm("Are you sure you want to delete this task?")
if (answer)
@model.destroy()
this.remove()
window.location.hash = "#"
return false
render : ->
$(@el).html(@template(@model.toJSON() ))