1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

編集状態でのMarkdown preview追加

This commit is contained in:
Rokt33r
2015-10-31 19:06:14 +09:00
parent 60e551e273
commit ca79857386
5 changed files with 46 additions and 15 deletions

View File

@@ -16,6 +16,8 @@ const TAG_FILTER = 'TAG_FILTER'
class HomePage extends React.Component {
componentDidMount () {
// React自体のKey入力はfocusされていないElementからは動かないため、
// `window`に直接かける
this.listener = (e) => this.handleKeyDown(e)
window.addEventListener('keydown', this.listener)
}
@@ -33,6 +35,7 @@ class HomePage extends React.Component {
let { status } = this.props
let { nav, top, list, detail } = this.refs
// Search inputがfocusされていたら大体のキー入力は無視される。
if (top.isInputFocused() && !e.metaKey) {
if (e.keyCode === 13 || e.keyCode === 27) top.escape()
return