add a confirmation when deleting components

This commit is contained in:
Chris Dodge
2012-10-15 11:24:34 -04:00
parent 57df208930
commit 4d439bbe03

View File

@@ -117,6 +117,8 @@ class CMS.Views.UnitEdit extends Backbone.View
@model.save()
deleteComponent: (event) =>
if not confirm 'Are you sure you want to delete this component? This action cannot be undone.'
return
$component = $(event.currentTarget).parents('.component')
$.post('/delete_item', {
id: $component.data('id')