mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-04 10:22:38 +00:00
Lint
This commit is contained in:
@@ -68,10 +68,9 @@ const Editor = createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
handleInject : function(injectText){
|
handleInject : function(injectText){
|
||||||
const text = (
|
let text;
|
||||||
this.isText() ? this.props.brew.text :
|
if(this.isText()) text = this.props.brew.text;
|
||||||
this.isStyle() ? this.props.brew.style ?? DEFAULT_STYLE_TEXT : ''
|
if(this.isStyle()) text = this.props.brew.style ?? DEFAULT_STYLE_TEXT;
|
||||||
);
|
|
||||||
|
|
||||||
const lines = text.split('\n');
|
const lines = text.split('\n');
|
||||||
const cursorPos = this.refs.codeEditor.getCursorPosition();
|
const cursorPos = this.refs.codeEditor.getCursorPosition();
|
||||||
@@ -79,7 +78,7 @@ const Editor = createClass({
|
|||||||
|
|
||||||
this.refs.codeEditor.setCursorPosition(cursorPos.line + injectText.split('\n').length, cursorPos.ch + injectText.length);
|
this.refs.codeEditor.setCursorPosition(cursorPos.line + injectText.split('\n').length, cursorPos.ch + injectText.length);
|
||||||
|
|
||||||
if(this.isText()) this.props.onTextChange(lines.join('\n'));
|
if(this.isText()) this.props.onTextChange(lines.join('\n'));
|
||||||
if(this.isStyle()) this.props.onStyleChange(lines.join('\n'));
|
if(this.isStyle()) this.props.onStyleChange(lines.join('\n'));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user