mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-24 20:42:43 +00:00
Move state change to handleViewChange
This commit is contained in:
@@ -96,6 +96,7 @@ const Editor = createClass({
|
||||
},
|
||||
|
||||
handleViewChange : function(newView){
|
||||
this.props.setMoveArrows(newView === 'text');
|
||||
this.setState({
|
||||
view : newView
|
||||
}, this.updateEditorSize); //TODO: not sure if updateeditorsize needed
|
||||
@@ -232,7 +233,6 @@ const Editor = createClass({
|
||||
|
||||
renderEditor : function(){
|
||||
if(this.isText()){
|
||||
this.props.setMoveArrows(true);
|
||||
return <>
|
||||
<CodeEditor key='codeEditor'
|
||||
ref='codeEditor'
|
||||
@@ -244,7 +244,6 @@ const Editor = createClass({
|
||||
</>;
|
||||
}
|
||||
if(this.isStyle()){
|
||||
this.props.setMoveArrows(false);
|
||||
return <>
|
||||
<CodeEditor key='codeEditor'
|
||||
ref='codeEditor'
|
||||
@@ -257,7 +256,6 @@ const Editor = createClass({
|
||||
</>;
|
||||
}
|
||||
if(this.isMeta()){
|
||||
this.props.setMoveArrows(false);
|
||||
return <>
|
||||
<CodeEditor key='codeEditor'
|
||||
view={this.state.view}
|
||||
|
||||
Reference in New Issue
Block a user