Trying out a reddit share button, looks promising
This commit is contained in:
1 parent
1db6553365
commit
133dd7c144
5 files changed
+61
-16
No files matched your search
@@ -18,6 +18,7 @@ var CodeEditor = React.createClass({
|
||||
return {
|
||||
language : '',
|
||||
value : '',
|
||||
wrap : false,
|
||||
onChange : function(){},
|
||||
onCursorActivity : function(){},
|
||||
};
|
||||
@@ -27,6 +28,7 @@ var CodeEditor = React.createClass({
|
||||
this.codeMirror = CodeMirror(this.refs.editor,{
|
||||
value : this.props.value,
|
||||
lineNumbers: true,
|
||||
lineWrapping : this.props.wrap,
|
||||
mode : this.props.language
|
||||
});
|
||||
|
||||
@@ -34,7 +36,7 @@ var CodeEditor = React.createClass({
|
||||
this.codeMirror.on('cursorActivity', this.handleCursorActivity);
|
||||
},
|
||||
|
||||
componentWillReceiveProps: _.debounce((nextProps)=>{
|
||||
componentWillReceiveProps: _.debounce(function(nextProps){
|
||||
if(this.codeMirror && nextProps.value !== undefined && this.codeMirror.getValue() != nextProps.value) {
|
||||
this.codeMirror.setValue(nextProps.value);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user