summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Pretto Nunes <anunes@thoughtworks.com>2015-01-24 13:28:32 -0200
committerPixpoa pairing <pixpoapairing@pixelated-project.org>2015-01-29 14:55:22 -0200
commit1af7c273015246c0cf4130278b2c17fca9de563a (patch)
tree5b86c94945d398d4846612b9a0d197b9ac157d95
parent494960adc6ed4444e1b7d2ce027567ceefb2f972 (diff)
Small refactor on mail items
-rw-r--r--web-ui/app/js/mail_list/ui/mail_items/draft_item.js6
-rw-r--r--web-ui/app/js/mail_list/ui/mail_items/generic_mail_item.js6
-rw-r--r--web-ui/app/js/mail_list/ui/mail_items/mail_item.js4
-rw-r--r--web-ui/app/js/mail_list/ui/mail_items/sent_item.js6
-rw-r--r--web-ui/app/js/services/delete_service.js1
5 files changed, 8 insertions, 15 deletions
diff --git a/web-ui/app/js/mail_list/ui/mail_items/draft_item.js b/web-ui/app/js/mail_list/ui/mail_items/draft_item.js
index a2da917f..fda6c3f8 100644
--- a/web-ui/app/js/mail_list/ui/mail_items/draft_item.js
+++ b/web-ui/app/js/mail_list/ui/mail_items/draft_item.js
@@ -29,12 +29,8 @@ define(
return defineComponent(draftItem, mailItem);
function draftItem() {
- function isOpeningOnANewTab(ev) {
- return ev.metaKey || ev.ctrlKey || ev.which === 2;
- }
-
this.triggerOpenMail = function (ev) {
- if (isOpeningOnANewTab(ev)) {
+ if (this.isOpeningOnANewTab(ev)) {
return;
}
this.trigger(document, events.dispatchers.rightPane.openDraft, { ident: this.attr.ident });
diff --git a/web-ui/app/js/mail_list/ui/mail_items/generic_mail_item.js b/web-ui/app/js/mail_list/ui/mail_items/generic_mail_item.js
index 3931ffd8..b700eeeb 100644
--- a/web-ui/app/js/mail_list/ui/mail_items/generic_mail_item.js
+++ b/web-ui/app/js/mail_list/ui/mail_items/generic_mail_item.js
@@ -33,12 +33,8 @@ define(
READ: 'read'
};
- function isOpeningOnANewTab(ev) {
- return ev.metaKey || ev.ctrlKey || ev.which === 2;
- }
-
this.triggerOpenMail = function (ev) {
- if (isOpeningOnANewTab(ev)) {
+ if (this.isOpeningOnANewTab(ev)) {
updateMailStatusToRead.call(this);
return;
}
diff --git a/web-ui/app/js/mail_list/ui/mail_items/mail_item.js b/web-ui/app/js/mail_list/ui/mail_items/mail_item.js
index f7ae2f0c..bcd0444b 100644
--- a/web-ui/app/js/mail_list/ui/mail_items/mail_item.js
+++ b/web-ui/app/js/mail_list/ui/mail_items/mail_item.js
@@ -34,6 +34,10 @@ define(
return viewHelper.getFormattedDate(new Date(date));
};
+ this.isOpeningOnANewTab = function (ev) {
+ return ev.metaKey || ev.ctrlKey || ev.which === 2;
+ };
+
this.doSelect = function () {
this.$node.addClass('selected');
};
diff --git a/web-ui/app/js/mail_list/ui/mail_items/sent_item.js b/web-ui/app/js/mail_list/ui/mail_items/sent_item.js
index 3e2e2723..3cfa25bd 100644
--- a/web-ui/app/js/mail_list/ui/mail_items/sent_item.js
+++ b/web-ui/app/js/mail_list/ui/mail_items/sent_item.js
@@ -28,12 +28,8 @@ define(
return defineComponent(sentItem, mailItem);
function sentItem() {
- function isOpeningOnANewTab(ev) {
- return ev.metaKey || ev.ctrlKey || ev.which === 2;
- }
-
this.triggerOpenMail = function (ev) {
- if (isOpeningOnANewTab(ev)) {
+ if (this.isOpeningOnANewTab(ev)) {
return;
}
this.trigger(document, events.ui.mail.open, { ident: this.attr.ident });
diff --git a/web-ui/app/js/services/delete_service.js b/web-ui/app/js/services/delete_service.js
index 470ab145..5cf86d63 100644
--- a/web-ui/app/js/services/delete_service.js
+++ b/web-ui/app/js/services/delete_service.js
@@ -47,6 +47,7 @@ define(['flight/lib/component', 'page/events', 'views/i18n'], function (defineCo
mails: emails,
successMessage: this.successDeleteManyMessageFor(firstEmail)
});
+
};
this.after('initialize', function () {