Reply all behavior and button click capturing

Summary:
If an email is to a group, the reply button should have `To` set the original email sender and `Cc` the group Fixes Phab ticket 2142. Previously, the click on the reply button was not captured unless the click occured on the reply or reply all icon. Changed the span to a div with no padding that captures all clicks

Test Plan: tested manually, unit tests

Reviewers: bengotow

Reviewed By: bengotow

Subscribers: evan

Maniphest Tasks: T2142

Differential Revision: https://phab.nylas.com/D1696
This commit is contained in:
EthanBlackburn 2015-06-26 16:45:05 -07:00
parent 93ea7ec039
commit 067834839c
3 changed files with 19 additions and 3 deletions

View file

@ -1,5 +1,5 @@
React = require 'react'
{Actions} = require 'nylas-exports'
{Actions, NamespaceStore} = require 'nylas-exports'
{RetinaImg, ButtonDropdown} = require 'nylas-component-kit'
class MessageControls extends React.Component
@ -31,6 +31,16 @@ class MessageControls extends React.Component
{button}
</div>
_primaryMessageAction: =>
if @_replyType() is "reply"
<div className="primary-message-action" onClick={@_onReply}>
<RetinaImg name="reply-footer.png" mode={RetinaImg.Mode.ContentIsMask}/>
</div>
else # if "reply-all"
<div className="primary-message-action" onClick={@_onReplyAll}>
<RetinaImg name="reply-all-footer.png" mode={RetinaImg.Mode.ContentIsMask}/>
</div>
_secondaryMessageActions: ->
if @_replyType() is "reply"
return [@_replyAllAction(), @_forwardAction()]
@ -60,7 +70,9 @@ class MessageControls extends React.Component
Actions.composeForward(thread: @props.thread, message: @props.message)
_replyType: =>
if @props.message.cc.length is 0 and @props.message.to.length is 1
emails = @props.message.to.map (item) -> item.email.toLowerCase().trim()
myEmail = NamespaceStore.current()?.me().email.toLowerCase().trim()
if @props.message.cc.length is 0 and @props.message.to.length is 1 and emails[0] is myEmail
return "reply"
else return "reply-all"

View file

@ -255,6 +255,10 @@
padding-bottom: @spacing-standard;
padding-top: 19px;
.primary-message-action{
padding: 7px 1em;
}
.message-actions-wrap {
text-align: right;
}

View file

@ -7,7 +7,7 @@
.btn();
height: 32px;
border-radius: 4px 0 0 4px;
padding-top: 7px;
padding: 0;
}
.secondary-picker {
.btn();