UX: Make abondon post confirmation button red.
This commit is contained in:
parent
5fa5c18a48
commit
5d28a1ac0d
|
@ -695,15 +695,21 @@ export default Ember.Controller.extend({
|
||||||
|
|
||||||
return new Ember.RSVP.Promise(function (resolve) {
|
return new Ember.RSVP.Promise(function (resolve) {
|
||||||
if (self.get('model.hasMetaData') || self.get('model.replyDirty')) {
|
if (self.get('model.hasMetaData') || self.get('model.replyDirty')) {
|
||||||
bootbox.confirm(I18n.t("post.abandon.confirm"), I18n.t("post.abandon.no_value"),
|
bootbox.dialog(I18n.t("post.abandon.confirm"), [
|
||||||
I18n.t("post.abandon.yes_value"), function(result) {
|
{ label: I18n.t("post.abandon.no_value") },
|
||||||
if (result) {
|
{
|
||||||
self.destroyDraft();
|
label: I18n.t("post.abandon.yes_value"),
|
||||||
self.get('model').clearState();
|
'class': 'btn-danger',
|
||||||
self.close();
|
callback(result) {
|
||||||
resolve();
|
if (result) {
|
||||||
|
self.destroyDraft();
|
||||||
|
self.get('model').clearState();
|
||||||
|
self.close();
|
||||||
|
resolve();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
]);
|
||||||
} else {
|
} else {
|
||||||
// it is possible there is some sort of crazy draft with no body ... just give up on it
|
// it is possible there is some sort of crazy draft with no body ... just give up on it
|
||||||
self.destroyDraft();
|
self.destroyDraft();
|
||||||
|
|
Loading…
Reference in New Issue