UX: Make abondon post confirmation button red.

This commit is contained in:
clapmyhands 2017-04-13 21:57:32 +08:00 committed by Guo Xiang Tan
parent 5fa5c18a48
commit 5d28a1ac0d
1 changed files with 14 additions and 8 deletions

View File

@ -695,15 +695,21 @@ export default Ember.Controller.extend({
return new Ember.RSVP.Promise(function (resolve) {
if (self.get('model.hasMetaData') || self.get('model.replyDirty')) {
bootbox.confirm(I18n.t("post.abandon.confirm"), I18n.t("post.abandon.no_value"),
I18n.t("post.abandon.yes_value"), function(result) {
if (result) {
self.destroyDraft();
self.get('model').clearState();
self.close();
resolve();
bootbox.dialog(I18n.t("post.abandon.confirm"), [
{ label: I18n.t("post.abandon.no_value") },
{
label: I18n.t("post.abandon.yes_value"),
'class': 'btn-danger',
callback(result) {
if (result) {
self.destroyDraft();
self.get('model').clearState();
self.close();
resolve();
}
}
}
});
]);
} else {
// it is possible there is some sort of crazy draft with no body ... just give up on it
self.destroyDraft();