1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-24 07:01:48 +00:00

実装 - Hotkey

This commit is contained in:
Rokt33r
2015-08-22 23:57:37 +09:00
parent b88d5cfb06
commit da066fe694
24 changed files with 378 additions and 61 deletions

View File

@@ -5,11 +5,12 @@ var React = require('react/addons')
var Hq = require('../Services/Hq')
var LinkedState = require('../Mixins/LinkedState')
var KeyCaster = require('../Mixins/KeyCaster')
var PlanetStore = require('../Stores/PlanetStore')
module.exports = React.createClass({
mixins: [LinkedState],
mixins: [LinkedState, KeyCaster('planetCreateModal')],
propTypes: {
ownerName: React.PropTypes.string,
transitionTo: React.PropTypes.func,
@@ -30,9 +31,14 @@ module.exports = React.createClass({
componentDidMount: function () {
React.findDOMNode(this.refs.name).focus()
},
onListen: function (res) {
if (res.status === 'planetCreated') {
this.props.close()
onKeyCast: function (e) {
switch (e.status) {
case 'closeModal':
this.props.close()
break
case 'submitPlanetCreateModal':
this.handleSubmit()
break
}
},
handleSubmit: function () {