mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-11 18:32:20 +08:00
a6f9e84c9a
- Fix reference to actual DestroyDraftTask class inside syncback-draft-task
26 lines
741 B
CoffeeScript
26 lines
741 B
CoffeeScript
React = require "react"
|
|
{RetinaImg} = require 'nylas-component-kit'
|
|
{Actions, FocusedContentStore} = require "nylas-exports"
|
|
|
|
class DraftDeleteButton extends React.Component
|
|
@displayName: 'DraftDeleteButton'
|
|
@containerRequired: false
|
|
|
|
@propTypes:
|
|
selection: React.PropTypes.object.isRequired
|
|
|
|
render: ->
|
|
<button style={order:-100}
|
|
className="btn btn-toolbar"
|
|
title="Delete"
|
|
onClick={@_destroySelected}>
|
|
<RetinaImg name="icon-composer-trash.png" mode={RetinaImg.Mode.ContentIsMask} />
|
|
</button>
|
|
|
|
_destroySelected: =>
|
|
for item in @props.selection.items()
|
|
Actions.destroyDraft(item.clientId)
|
|
@props.selection.clear()
|
|
return
|
|
|
|
module.exports = {DraftDeleteButton}
|