UX: Add confirmation when deleting a staff note
This commit is contained in:
parent
550d5c73f4
commit
228462b159
|
@ -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);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -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?"
|
||||||
|
|
Loading…
Reference in New Issue