diff options
Diffstat (limited to 'web-ui')
-rw-r--r-- | web-ui/app/images/logo.svg | 30 | ||||
-rw-r--r-- | web-ui/app/js/mail_view/ui/mail_view.js | 1 | ||||
-rw-r--r-- | web-ui/app/js/mail_view/ui/reply_section.js | 20 | ||||
-rw-r--r-- | web-ui/app/js/page/events.js | 3 | ||||
-rw-r--r-- | web-ui/test/spec/mail_view/ui/mail_view.spec.js | 5 | ||||
-rw-r--r-- | web-ui/test/spec/mail_view/ui/reply_section.spec.js | 16 |
6 files changed, 69 insertions, 6 deletions
diff --git a/web-ui/app/images/logo.svg b/web-ui/app/images/logo.svg new file mode 100644 index 00000000..6c2d8989 --- /dev/null +++ b/web-ui/app/images/logo.svg @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="30.4 627.3 612 171.1" enable-background="new 30.4 627.3 612 171.1" xml:space="preserve"> +<g> + <path fill="#3E3B38" d="M30.4,669.9v85.8l75.5,42.7l75.5-42.7v-85.8l-75.5-42.7L30.4,669.9z M102.7,767.4l-44-24.3v-52.6l44,25 + V767.4z M152.5,743l-43.4,24.3v-51.8l43.4-25.4V743z M152.5,683.1l-46.7,27.8l-47.2-27.8l47.2-25.4L152.5,683.1z"/> + <path fill="#3E3B38" d="M233.8,678.3h-24v71.2h16.2v-26.5h7.8c14,0,24.3-8,24.3-22.9C258.1,685.6,247.6,678.3,233.8,678.3z + M230.6,710.2h-4.6v-18.8h4.6c6.5,0,12.5,2.2,12.5,9.5C243,708.1,237.1,710.2,230.6,710.2z"/> + <rect x="263.5" y="678.3" fill="#3E3B38" width="16.2" height="71.2"/> + <polygon fill="#3E3B38" points="350.4,678.3 330.1,678.3 316.9,697.7 303.7,678.3 284.6,678.3 307,711.1 282.6,749.5 302.9,749.5 + 316.9,725.3 331,749.5 352.1,749.5 326.9,711.1 "/> + <polygon fill="#3E3B38" points="354.7,749.5 395.5,749.5 395.5,735.2 370.9,735.2 370.9,721 394.4,721 394.4,706.6 370.9,706.6 + 370.9,692.5 395.5,692.5 395.5,678.3 354.7,678.3 "/> + <path fill="#3E3B38" d="M456.1,678.3l-22.9,57h-15.9v-57h-16.2v71.2h26.5h14.3h3.2l5.4-14.3h27l5.4,14.3h17.5l-28.9-71.2H456.1z + M455.7,721l7.8-20.7h0.2l7.8,20.7H455.7z"/> + <polygon fill="#3E3B38" points="486.4,692.5 503.4,692.5 503.4,749.5 519.6,749.5 519.6,692.5 536.6,692.5 536.6,678.3 + 486.4,678.3 "/> + <polygon fill="#3E3B38" points="542,749.5 582.8,749.5 582.8,735.2 558.4,735.2 558.4,721 581.9,721 581.9,706.6 558.4,706.6 + 558.4,692.5 582.8,692.5 582.8,678.3 542,678.3 "/> + <path fill="#3E3B38" d="M606.5,678.3h-17.9v71.2h17.9c19.7,0,35.9-14.9,35.9-35.6C642.4,693.1,625.9,678.3,606.5,678.3z M607,735 + h-2.4v-42.1h2.4c12.1,0,20.3,9.1,20.3,21.1C627.3,725.8,619.1,735,607,735z"/> +</g> +<polygon id="clock1" fill="#3E3B38" points="105.8,657.8 105.8,628 105.8,627.3 181.4,669.9 152.5,683.1 "/> +<polygon id="clock2" fill="#3E3B38" points="152.5,683.1 181.4,669.9 181.4,755.7 152.5,743 "/> +<polygon id="clock3" fill="#3E3B38" points="105.9,798.3 105.9,769 152.5,743 181.4,755.7 "/> +<polygon id="clock4" fill="#3E3B38" points="58.7,743.1 105.9,769 105.9,798.3 30.4,755.7 "/> +<polygon id="clock5" fill="#3E3B38" points="30.4,669.9 58.6,683.1 58.7,743.1 30.4,755.7 "/> +<polygon id="clock6" fill="#3E3B38" points="105.8,628 105.8,657.8 58.6,683.1 30.4,669.9 105.8,627.3 "/> +</svg> diff --git a/web-ui/app/js/mail_view/ui/mail_view.js b/web-ui/app/js/mail_view/ui/mail_view.js index 8465b45a..dfc57585 100644 --- a/web-ui/app/js/mail_view/ui/mail_view.js +++ b/web-ui/app/js/mail_view/ui/mail_view.js @@ -76,6 +76,7 @@ define( this.trigger(document, events.search.highlightResults, {where: '.bodyArea'}); this.trigger(document, events.search.highlightResults, {where: '.subjectArea'}); this.trigger(document, events.search.highlightResults, {where: '.msg-header .recipients'}); + this.trigger(document, events.ui.replyBox.showReplyContainer); this.attachTagCompletion(this.attr.mail); 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..cbe64205 100644 --- a/web-ui/app/js/mail_view/ui/reply_section.js +++ b/web-ui/app/js/mail_view/ui/reply_section.js @@ -36,7 +36,8 @@ define( replyAllButton: '#reply-all-button', forwardButton: '#forward-button', replyBox: '#reply-box', - replyType: 'reply' + replyType: 'reply', + replyContainer: '.reply-container' }); this.showReply = function() { @@ -64,9 +65,7 @@ define( this.checkForDraftReply = function() { this.render(); - this.select('replyButton').hide(); - this.select('replyAllButton').hide(); - this.select('forwardButton').hide(); + this.hideContainer(); this.trigger(document, events.mail.draftReply.want, {ident: this.attr.ident}); }; @@ -76,11 +75,13 @@ define( }; this.showDraftReply = function(ev, data) { + this.showContainer(); this.hideButtons(); ReplyBox.attachTo(this.select('replyBox'), { mail: data.mail, draftReply: true }); }; this.showReplyComposeBox = function (ev, data) { + this.showContainer(); this.hideButtons(); if(this.attr.replyType === 'forward') { ForwardBox.attachTo(this.select('replyBox'), { mail: data.mail }); @@ -89,6 +90,14 @@ define( } }; + this.hideContainer = function() { + this.select('replyContainer').hide(); + }; + + this.showContainer = function() { + this.select('replyContainer').show(); + }; + this.hideButtons = function() { this.select('replyButton').hide(); this.select('replyAllButton').hide(); @@ -96,6 +105,7 @@ define( }; this.showButtons = function () { + this.showContainer(); this.select('replyBox').empty(); this.select('replyButton').show(); this.select('replyAllButton').show(); @@ -109,7 +119,7 @@ define( this.on(this, events.mail.here, this.showReplyComposeBox); this.on(document, events.dispatchers.rightPane.clear, this.teardown); - this.on(document, events.mail.draftReply.notFound, this.showButtons); + this.on(document, events.ui.replyBox.showReplyContainer, this.showContainer); this.on(document, events.mail.draftReply.here, this.showDraftReply); this.checkForDraftReply(); diff --git a/web-ui/app/js/page/events.js b/web-ui/app/js/page/events.js index 1ec27c46..7a0dbf9d 100644 --- a/web-ui/app/js/page/events.js +++ b/web-ui/app/js/page/events.js @@ -79,7 +79,8 @@ define(function () { }, replyBox: { showReply: 'ui:replyBox:showReply', - showReplyAll: 'ui:replyBox:showReplyAll' + showReplyAll: 'ui:replyBox:showReplyAll', + showReplyContainer: 'ui:replyBox:showReplyContainer', }, recipients: { entered: 'ui:recipients:entered', diff --git a/web-ui/test/spec/mail_view/ui/mail_view.spec.js b/web-ui/test/spec/mail_view/ui/mail_view.spec.js index ae874621..9ed56023 100644 --- a/web-ui/test/spec/mail_view/ui/mail_view.spec.js +++ b/web-ui/test/spec/mail_view/ui/mail_view.spec.js @@ -29,6 +29,11 @@ describeComponent('mail_view/ui/mail_view', function () { expect(openNoMessageSelectedEvent).toHaveBeenTriggeredOn(document); }); + it('should open reply container', function () { + var showContainerEvent = spyOnEvent(document, Pixelated.events.ui.replyBox.showReplyContainer); + this.component.displayMail({}, testData); + expect(showContainerEvent).toHaveBeenTriggeredOn(document); + }); it('removes the tag from the mail when the tag label is clicked', function() { var updateSpy = spyOnEvent(document, Pixelated.events.mail.tags.update); diff --git a/web-ui/test/spec/mail_view/ui/reply_section.spec.js b/web-ui/test/spec/mail_view/ui/reply_section.spec.js index 9cdf7405..00709684 100644 --- a/web-ui/test/spec/mail_view/ui/reply_section.spec.js +++ b/web-ui/test/spec/mail_view/ui/reply_section.spec.js @@ -5,6 +5,18 @@ describeComponent('mail_view/ui/reply_section', function () { this.setupComponent(); }); + describe('show/hide reply container', function () { + it('should hide reply container until mail data is loaded', function () { + this.component.checkForDraftReply(); + expect(this.component.select('replyContainer')).toBeHidden(); + }); + + it('should show reply container when mail data is loaded', function () { + this.component.trigger(document, Pixelated.events.ui.replyBox.showReplyContainer); + expect(this.component.select('replyContainer')).not.toBeHidden(); + }); + }); + describe('clicking reply buttons', function() { var mailWantEvent, expectEventData; @@ -45,6 +57,7 @@ describeComponent('mail_view/ui/reply_section', function () { this.component.attr.replyType = 'reply'; this.component.trigger(this.component, Pixelated.events.mail.here, { mail: mailData }); + expect(this.component.select('replyContainer')).not.toBeHidden(); expect(ReplyBox.attachTo).toHaveBeenCalledWith(jasmine.any(Object), { mail: mailData, replyType: 'reply' @@ -55,6 +68,7 @@ describeComponent('mail_view/ui/reply_section', function () { this.component.attr.replyType = 'replyall'; this.component.trigger(this.component, Pixelated.events.mail.here, { mail: mailData }); + expect(this.component.select('replyContainer')).not.toBeHidden(); expect(ReplyBox.attachTo).toHaveBeenCalledWith(jasmine.any(Object), { mail: mailData, replyType: 'replyall' @@ -65,6 +79,7 @@ describeComponent('mail_view/ui/reply_section', function () { this.component.attr.replyType = 'forward'; this.component.trigger(this.component, Pixelated.events.mail.here, { mail: mailData }); + expect(this.component.select('replyContainer')).not.toBeHidden(); expect(ForwardBox.attachTo).toHaveBeenCalledWith(jasmine.any(Object), { mail: mailData }); @@ -87,6 +102,7 @@ describeComponent('mail_view/ui/reply_section', function () { $(document).trigger(Pixelated.events.ui.composeBox.trashReply); + expect(this.component.select('replyContainer')).not.toBeHidden(); expect(this.component.select('replyButton')).not.toBeHidden(); expect(this.component.select('replyAllButton')).not.toBeHidden(); expect(this.component.select('forwardButton')).not.toBeHidden(); |