summaryrefslogtreecommitdiff
path: root/web-ui/app/js/mail_view/ui/compose_box.js
diff options
context:
space:
mode:
authorGiovane <giovaneliberato@gmail.com>2015-11-27 15:47:58 -0200
committerGiovane <giovaneliberato@gmail.com>2015-11-27 15:53:11 -0200
commit07be9f6109e3dff49775aa51f0a481b5fd524d3b (patch)
tree29e2df328027c60349d17a8f62fdd556fafceeb3 /web-ui/app/js/mail_view/ui/compose_box.js
parentc1476b4b1c96996464217444e8cdf5d94d248bea (diff)
Created a discard draft behaviour #512 w/ bwagner
If a draft was never saved before, and there wasn't any change to save, we now discard it instead saving and deleting it. This also lessens the calls to saveDraft that was causing some draft duplication.
Diffstat (limited to 'web-ui/app/js/mail_view/ui/compose_box.js')
-rw-r--r--web-ui/app/js/mail_view/ui/compose_box.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/web-ui/app/js/mail_view/ui/compose_box.js b/web-ui/app/js/mail_view/ui/compose_box.js
index 92588310..dcc8fd76 100644
--- a/web-ui/app/js/mail_view/ui/compose_box.js
+++ b/web-ui/app/js/mail_view/ui/compose_box.js
@@ -67,13 +67,15 @@ define(
}
};
+ this.discardDraft = function () {
+ this.trigger(events.dispatchers.rightPane.openNoMessageSelected);
+ };
+
this.after('initialize', function () {
this.renderComposeBox();
this.select('toBox').focus();
- this.on(this.select('cancelButton'), 'click', this.showNoMessageSelected);
this.on(document, events.mail.deleted, this.mailDeleted);
-
this.on(document, events.mail.sent, this.showNoMessageSelected);
});
}