Add a confirm dialog when deleting templates
This commit is contained in:
parent
bb0bebe8f7
commit
2db5e72bcb
2 changed files with 21 additions and 17 deletions
|
@ -1,6 +1,7 @@
|
|||
require('../../common/pikaday-timepicker')
|
||||
require('../../components/wizard')
|
||||
require('../../common/image_uploader')
|
||||
var confirmation = require('../../common/confirmation')
|
||||
var format_err = require('../../common/format_response_error')
|
||||
|
||||
appl.def('advance_campaign_template_name_step', function(form_obj) {
|
||||
|
@ -50,6 +51,8 @@ function post_campaign_template(form_data) {
|
|||
}
|
||||
|
||||
appl.def('delete_template', function(id) {
|
||||
var result = confirmation('Are you sure?')
|
||||
result.confirmed = function() {
|
||||
appl.def('loading', true)
|
||||
var url = '/nonprofits/' + app.nonprofit_id + '/campaign_templates/' + id
|
||||
|
||||
|
@ -67,4 +70,5 @@ appl.def('delete_template', function(id) {
|
|||
appl.notify('Successfully deleted template.')
|
||||
appl.redirect('/nonprofits/' + app.nonprofit_id + '/campaign_templates')
|
||||
})
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue