summaryrefslogtreecommitdiff
path: root/web-ui/app/js/mail_view/ui
diff options
context:
space:
mode:
authorJefferson Stachelski <jstachel@thoughtworks.com>2015-12-31 16:52:49 -0200
committerJefferson Stachelski <jstachel@thoughtworks.com>2015-12-31 16:52:49 -0200
commitaa66beb0c74ebaa950a083ed991f6e5f50f9c9ac (patch)
treee0df762cef10651b025058fb75733f5e125b6e98 /web-ui/app/js/mail_view/ui
parent111205c8cd74d553201b42db3041d870ae833165 (diff)
Issue #25 - Implemented shortcuts on UI
Diffstat (limited to 'web-ui/app/js/mail_view/ui')
-rw-r--r--web-ui/app/js/mail_view/ui/mail_actions.js15
-rw-r--r--web-ui/app/js/mail_view/ui/reply_section.js4
2 files changed, 11 insertions, 8 deletions
diff --git a/web-ui/app/js/mail_view/ui/mail_actions.js b/web-ui/app/js/mail_view/ui/mail_actions.js
index 65cd0aaa..aa90169f 100644
--- a/web-ui/app/js/mail_view/ui/mail_actions.js
+++ b/web-ui/app/js/mail_view/ui/mail_actions.js
@@ -37,11 +37,13 @@ define(
moreActions: '#more-actions'
});
+ this.deleteMail = function () {
+ this.trigger(document, events.ui.mail.delete, {mail: this.attr.mail});
+ this.select('moreActions').hide();
+ };
this.displayMailActions = function () {
-
this.$node.html(templates.mails.mailActions());
-
this.select('moreActions').hide();
this.on(this.select('replyButtonTop'), 'click', function () {
@@ -53,11 +55,6 @@ define(
this.select('moreActions').hide();
}.bind(this));
- this.on(this.select('deleteButtonTop'), 'click', function () {
- this.trigger(document, events.ui.mail.delete, {mail: this.attr.mail});
- this.select('moreActions').hide();
- }.bind(this));
-
this.on(this.select('viewMoreActions'), 'click', function () {
this.select('moreActions').toggle();
}.bind(this));
@@ -72,12 +69,14 @@ define(
this.select('moreActions').hide();
}
}.bind(this));
-
};
this.after('initialize', function () {
this.on(document, events.dispatchers.rightPane.clear, this.teardown);
+ this.on(document, events.shortcuts.deleteMail, this.deleteMail);
+
this.displayMailActions();
+ this.on(this.select('deleteButtonTop'), 'click', this.deleteMail);
});
}
}
diff --git a/web-ui/app/js/mail_view/ui/reply_section.js b/web-ui/app/js/mail_view/ui/reply_section.js
index 46dfe863..71e27b1e 100644
--- a/web-ui/app/js/mail_view/ui/reply_section.js
+++ b/web-ui/app/js/mail_view/ui/reply_section.js
@@ -112,6 +112,10 @@ define(
this.on(document, events.mail.draftReply.notFound, this.showButtons);
this.on(document, events.mail.draftReply.here, this.showDraftReply);
+ this.on(document, events.shortcuts.replyMail, this.showReply);
+ this.on(document, events.shortcuts.replyAllMail, this.showReplyAll);
+ this.on(document, events.shortcuts.forwardMail, this.showForward);
+
this.checkForDraftReply();
});
}