Browse Source

Merge branch 'chenglou-master'

Conflicts:
	docs/_js/examples/markdown.js
main
Paul O’Shannessy 12 years ago
parent
commit
c3b5e071e5
  1. 9
      _js/examples/markdown.js
  2. 4
      _js/examples/todo.js

9
_js/examples/markdown.js

@ -11,16 +11,17 @@ var MarkdownEditor = React.createClass({\n\
getInitialState: function() {\n\
return {value: 'Type some *markdown* here!'};\n\
},\n\
handleInput: function() {\n\
handleChange: function() {\n\
this.setState({value: this.refs.textarea.getDOMNode().value});\n\
},\n\
render: function() {\n\
return (\n\
<div className=\"MarkdownEditor\">\n\
<h3>Input</h3>\n\
<textarea onInput={this.handleInput} ref=\"textarea\">\n\
{this.state.value}\n\
</textarea>\n\
<textarea\n\
onChange={this.handleChange}\n\
ref=\"textarea\"\n\
defaultValue={this.state.value} />\n\
<h3>Output</h3>\n\
<div\n\
className=\"content\"\n\

4
_js/examples/todo.js

@ -30,8 +30,8 @@ var TodoApp = React.createClass({\n\
<div>\n\
<h3>TODO</h3>\n\
<TodoList items={this.state.items} />\n\
<form onSubmit={this.handleSubmit.bind(this)}>\n\
<input onKeyUp={this.onKey.bind(this)} value={this.state.text} />\n\
<form onSubmit={this.handleSubmit}>\n\
<input onKeyUp={this.onKey} defaultValue={this.state.text} />\n\
<button>{'Add #' + (this.state.items.length + 1)}</button>\n\
</form>\n\
</div>\n\

Loading…
Cancel
Save