2015-05-20 07:06:59 +08:00
|
|
|
_ = require 'underscore'
|
2015-05-14 03:01:41 +08:00
|
|
|
React = require 'react'
|
2015-07-22 02:34:47 +08:00
|
|
|
{Actions, DOMUtils} = require 'nylas-exports'
|
2015-05-15 08:08:30 +08:00
|
|
|
{RetinaImg} = require 'nylas-component-kit'
|
2015-05-14 03:01:41 +08:00
|
|
|
|
2015-07-22 05:16:11 +08:00
|
|
|
class ThreadArchiveButton extends React.Component
|
|
|
|
@displayName: "ThreadArchiveButton"
|
2015-07-24 02:47:46 +08:00
|
|
|
@containerRequired: false
|
2015-05-14 03:01:41 +08:00
|
|
|
|
|
|
|
render: =>
|
|
|
|
<button className="btn btn-toolbar btn-archive"
|
2015-07-24 03:22:27 +08:00
|
|
|
style={order: -105}
|
2015-05-14 03:01:41 +08:00
|
|
|
data-tooltip="Archive"
|
|
|
|
onClick={@_onArchive}>
|
2015-06-06 02:40:44 +08:00
|
|
|
<RetinaImg name="toolbar-archive.png" mode={RetinaImg.Mode.ContentIsMask}/>
|
2015-05-14 03:01:41 +08:00
|
|
|
</button>
|
|
|
|
|
|
|
|
_onArchive: (e) =>
|
2015-07-22 02:34:47 +08:00
|
|
|
return unless DOMUtils.nodeIsVisible(e.currentTarget)
|
2015-05-14 03:01:41 +08:00
|
|
|
Actions.archive()
|
|
|
|
e.stopPropagation()
|
|
|
|
|
|
|
|
|
2015-07-22 05:16:11 +08:00
|
|
|
module.exports = ThreadArchiveButton
|