mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-06 08:08:10 +08:00
eb6cc11a83
Summary: fix(keymappings): Enter to focus item, logout works now Minor fix for some problems with activity bar Fix tabindex = 1 where tabindex should be =-1 Remove idgen that was causing footers to be replaced WIP Draft store extension hooks Test Plan: Run tests Reviewers: evan Reviewed By: evan Differential Revision: https://review.inboxapp.com/D1320
37 lines
957 B
CoffeeScript
37 lines
957 B
CoffeeScript
_ = require 'underscore-plus'
|
|
React = require 'react'
|
|
{Actions, Message, DraftStore} = require 'inbox-exports'
|
|
|
|
module.exports =
|
|
TemplateStatusBar = React.createClass
|
|
displayName: 'TemplateStatusBar'
|
|
|
|
propTypes:
|
|
draftLocalId: React.PropTypes.string
|
|
|
|
getInitialState: ->
|
|
draft: null
|
|
|
|
componentDidMount: ->
|
|
@_proxy = DraftStore.sessionForLocalId(@props.draftLocalId)
|
|
@unsubscribe = @_proxy.listen(@_onDraftChange, @)
|
|
if @_proxy.draft()
|
|
@_onDraftChange()
|
|
|
|
componentWillUnmount: ->
|
|
@unsubscribe() if @unsubscribe
|
|
|
|
render: ->
|
|
if @_draftUsesTemplate()
|
|
<div className="template-status-bar">
|
|
Press "tab" to quickly fill in the blanks - highlighting will not be visible to recipients.
|
|
</div>
|
|
else
|
|
<div></div>
|
|
|
|
_onDraftChange: ->
|
|
@setState(draft: @_proxy.draft())
|
|
|
|
_draftUsesTemplate: ->
|
|
return unless @state.draft
|
|
@state.draft.body.search(/<code[^>]*class="var[^>]*>/i) > 0
|