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) { removeNote(note) {
bootbox.confirm(I18n.t("staff_notes.delete_confirm"), I18n.t("no_value"), I18n.t("yes_value"), result => {
if (result) {
note.destroyRecord().then(() => { note.destroyRecord().then(() => {
const notes = this.get('model'); const notes = this.get('model');
notes.removeObject(note); notes.removeObject(note);
this._refreshCount(); this._refreshCount();
}).catch(popupAjaxError); }).catch(popupAjaxError);
} }
});
}
} }
}); });

View File

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