diff options
Diffstat (limited to 'web-ui')
-rw-r--r-- | web-ui/app/js/mail_list/ui/mail_items/mail_item.js | 1 | ||||
-rw-r--r-- | web-ui/app/js/mail_view/ui/recipients/recipients_input.js | 3 | ||||
-rw-r--r-- | web-ui/app/scss/styles.scss | 5 | ||||
-rw-r--r-- | web-ui/app/templates/mails/full_view.hbs | 2 | ||||
-rw-r--r-- | web-ui/app/templates/mails/single.hbs | 9 | ||||
-rw-r--r-- | web-ui/test/spec/mail_list/ui/mail_list.spec.js | 2 | ||||
-rw-r--r-- | web-ui/test/spec/mail_view/ui/recipients/recipients_input.spec.js | 26 |
7 files changed, 41 insertions, 7 deletions
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 51ace714..24c7b043 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 @@ -64,6 +64,7 @@ define( this.attr.ident = mail.ident; this.attr.statuses = viewHelper.formatStatusClasses(mail.status); this.attr.tags = mail.tags; + this.attr.attachments = mail.attachments; this.attr.mailbox = mail.mailbox; this.attr.header.formattedDate = this.formattedDate(mail.header.date); }; diff --git a/web-ui/app/js/mail_view/ui/recipients/recipients_input.js b/web-ui/app/js/mail_view/ui/recipients/recipients_input.js index e9211d85..8f647d01 100644 --- a/web-ui/app/js/mail_view/ui/recipients/recipients_input.js +++ b/web-ui/app/js/mail_view/ui/recipients/recipients_input.js @@ -34,7 +34,6 @@ define([ 9: 'tab', 186: 'semicolon', 188: 'comma', - 32: 'space', 13: 'enter', 27: 'esc' }, @@ -101,7 +100,7 @@ define([ return; } - if (isEnterAddressKey(keyPressed)) { + if (!event.shiftKey && isEnterAddressKey(keyPressed)) { this.tokenizeRecipient(event); if ((keyPressed !== 9 /* tab */)) { diff --git a/web-ui/app/scss/styles.scss b/web-ui/app/scss/styles.scss index ef3691f0..7fe0ec05 100644 --- a/web-ui/app/scss/styles.scss +++ b/web-ui/app/scss/styles.scss @@ -133,6 +133,11 @@ right: 10px; font-size: 0.7em; } + + .attachment-indicator { + margin: 2px 0 0 25px; + font-size: initial; + } .from { white-space: nowrap; font-size: 0.8em; diff --git a/web-ui/app/templates/mails/full_view.hbs b/web-ui/app/templates/mails/full_view.hbs index 4cdf25b9..d05537f3 100644 --- a/web-ui/app/templates/mails/full_view.hbs +++ b/web-ui/app/templates/mails/full_view.hbs @@ -69,7 +69,7 @@ {{#if attachments}} <div class="attachmentsAreaWrap"> <div class="attachmentsArea column large-12"> - <p><strong> {{ attachments.length }} attachment(s):</strong></p> + <p><strong><i class="fa fa-paperclip"></i> {{ attachments.length }} attachment(s):</strong></p> <ul> {{#each attachments }} <li> diff --git a/web-ui/app/templates/mails/single.hbs b/web-ui/app/templates/mails/single.hbs index baf6251c..997ab44f 100644 --- a/web-ui/app/templates/mails/single.hbs +++ b/web-ui/app/templates/mails/single.hbs @@ -3,8 +3,13 @@ </span> <span> <a href="/#/{{ tag }}/mail/{{ ident }}"> - <span class="received-date">{{ header.formattedDate }}</span> - + <span class="received-date">{{ header.formattedDate }} + {{#if attachments}} + <div class="attachment-indicator"> + <i class="fa fa-paperclip"></i> + </div> + {{/if}} + </span> <div class="from">{{#if header.from }}{{ header.from }}{{else}}{{t "you"}}{{/if}}</div> <div class="subject-and-tags"> {{ header.subject }} diff --git a/web-ui/test/spec/mail_list/ui/mail_list.spec.js b/web-ui/test/spec/mail_list/ui/mail_list.spec.js index d90f906c..23ca87fb 100644 --- a/web-ui/test/spec/mail_list/ui/mail_list.spec.js +++ b/web-ui/test/spec/mail_list/ui/mail_list.spec.js @@ -225,7 +225,7 @@ describeComponent('mail_list/ui/mail_list', function () { expect(node.html()).toMatch('id="mail-' + mail.ident + '"'); expect(node.html()).toMatch('<div class="subject-and-tags">'); expect(node.html()).toMatch('<div class="from">' + mail.header.from + '</div>'); - expect(node.html()).toMatch('<span class="received-date">' + mail.header.formattedDate + '</span>'); + expect(node.html()).toMatch('<span class="received-date">' + mail.header.formattedDate); } function matchSelectedMail(mail, node) { diff --git a/web-ui/test/spec/mail_view/ui/recipients/recipients_input.spec.js b/web-ui/test/spec/mail_view/ui/recipients/recipients_input.spec.js index 6b486fa9..433c145b 100644 --- a/web-ui/test/spec/mail_view/ui/recipients/recipients_input.spec.js +++ b/web-ui/test/spec/mail_view/ui/recipients/recipients_input.spec.js @@ -10,7 +10,6 @@ describeComponent('mail_view/ui/recipients/recipients_input',function () { _.each([ [186, 'semicolon'], [188, 'comma'], - [32, 'space'] ], function (keycode) { @@ -34,6 +33,16 @@ describeComponent('mail_view/ui/recipients/recipients_input',function () { expect(addressEnteredEvent).not.toHaveBeenTriggeredOnAndWith(this, { name: 'to', address: '' }); }); + it('wont add address if shift key is pressed together: ' + keycode[1], function () { + var addressEnteredEvent = spyOnEvent(this.$node, Pixelated.events.ui.recipients.entered); + + var enterAddressKeyPressEvent = $.Event('keydown', { which: keycode[0], shiftKey: true }); + this.$node.val('a@b.c'); + this.$node.trigger(enterAddressKeyPressEvent); + + expect(addressEnteredEvent).not.toHaveBeenTriggeredOnAndWith(this, { name: 'to', address: 'a@b.c' }); + }); + it('prevents event default regardless on input val when key is ' + keycode[1], function () { var enterAddressKeyPressEvent = $.Event('keydown', { which: keycode[0] }); spyOn(enterAddressKeyPressEvent, 'preventDefault'); @@ -77,6 +86,21 @@ describeComponent('mail_view/ui/recipients/recipients_input',function () { expect(addressEnteredEvent).not.toHaveBeenTriggeredOnAndWith(this, { name: 'to', address: ''}); }); }); + + describe('when space is pressed', function () { + it('address input should not finish', function () { + var addressEnteredEvent = spyOnEvent(this.$node, Pixelated.events.ui.recipients.entered); + + var spaceKeyPressEvent = $.Event('keydown', { which: 32}); + spyOn(spaceKeyPressEvent, 'preventDefault'); + + this.$node.val('a@b.c'); + this.$node.trigger(spaceKeyPressEvent); + + expect(spaceKeyPressEvent.preventDefault).not.toHaveBeenCalled(); + expect(addressEnteredEvent).not.toHaveBeenTriggeredOnAndWith(this, { name: 'to', address: 'a@b.c' }); + }); + }); }); describe('on keyup', function () { |