1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-14 10:16:26 +00:00

add hotkey

This commit is contained in:
Rokt33r
2015-07-19 03:19:41 +09:00
parent aa71251edd
commit 16b60ada50
5 changed files with 34 additions and 6 deletions

View File

@@ -83,9 +83,14 @@ var SnippetForm = React.createClass({
PlanetActions.updateSnippet(snippetId, snippet)
}
},
handleKeyDown: function (e) {
if (e.keyCode === 13 && e.metaKey) {
this.submit()
}
},
render: function () {
return (
<div className='SnippetForm'>
<div onKeyDown={this.handleKeyDown} className='SnippetForm'>
<div className='modal-body'>
<div className='form-group'>
<textarea ref='description' className='snippetDescription block-input' valueLink={this.linkState('snippet.description')} placeholder='Description'/>