UX: Add confirmation when deleting a staff note

This commit is contained in:
Robin Ward 2016-04-01 12:35:03 -04:00
parent 550d5c73f4
commit 228462b159
2 changed files with 11 additions and 5 deletions

View File

@ -37,11 +37,16 @@ export default Ember.Controller.extend({
},
removeNote(note) {
note.destroyRecord().then(() => {
const notes = this.get('model');
notes.removeObject(note);
this._refreshCount();
}).catch(popupAjaxError);
bootbox.confirm(I18n.t("staff_notes.delete_confirm"), I18n.t("no_value"), I18n.t("yes_value"), result => {
if (result) {
note.destroyRecord().then(() => {
const notes = this.get('model');
notes.removeObject(note);
this._refreshCount();
}).catch(popupAjaxError);
}
});
}
}
});

View File

@ -5,3 +5,4 @@ en:
attach: "Attach Staff Note"
remove: "Remove Note"
show: "Staff Notes ({{count}})"
delete_confirm: "Are you sure you want to delete that staff note?"