mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-11 10:12:00 +08:00
fix(star): Bulk star icon has never shown current state(?!)
This commit is contained in:
parent
bb88d7be40
commit
b2074eefc6
1 changed files with 8 additions and 3 deletions
|
@ -68,14 +68,19 @@ class ThreadBulkStarButton extends React.Component
|
||||||
selection: React.PropTypes.object.isRequired
|
selection: React.PropTypes.object.isRequired
|
||||||
|
|
||||||
render: ->
|
render: ->
|
||||||
noStars = _.every @props.selection.items(), (t) -> _.isMatch(t, {starred: false})
|
postClickStarredState = _.every @props.selection.items(), (t) -> t.starred is false
|
||||||
title = if noStars then "Star all" else "Remove stars from all"
|
title = "Remove stars from all"
|
||||||
|
imageName = "toolbar-star-selected.png"
|
||||||
|
|
||||||
|
if postClickStarredState
|
||||||
|
title = "Star all"
|
||||||
|
imageName = "toolbar-star.png"
|
||||||
|
|
||||||
<button style={order:-104}
|
<button style={order:-104}
|
||||||
className="btn btn-toolbar"
|
className="btn btn-toolbar"
|
||||||
title={title}
|
title={title}
|
||||||
onClick={@_onStar}>
|
onClick={@_onStar}>
|
||||||
<RetinaImg name="toolbar-star.png" mode={RetinaImg.Mode.ContentIsMask} />
|
<RetinaImg name={imageName} mode={RetinaImg.Mode.ContentIsMask} />
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
_onStar: =>
|
_onStar: =>
|
||||||
|
|
Loading…
Reference in a new issue