mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-16 06:02:41 +00:00
Shift CSS link to CodeEditor render
This commit is contained in:
@@ -268,14 +268,9 @@ const Editor = createClass({
|
|||||||
this.forceUpdate();
|
this.forceUpdate();
|
||||||
},
|
},
|
||||||
|
|
||||||
renderEditorCSSLink : function(){
|
|
||||||
return <link href={`../homebrew/cm-themes/${this.state.editorTheme}.css`} rel='stylesheet' />;
|
|
||||||
},
|
|
||||||
|
|
||||||
renderEditor : function(){
|
renderEditor : function(){
|
||||||
if(this.isText()){
|
if(this.isText()){
|
||||||
return <>
|
return <>
|
||||||
{this.renderEditorCSSLink()}
|
|
||||||
<CodeEditor key='codeEditor'
|
<CodeEditor key='codeEditor'
|
||||||
ref='codeEditor'
|
ref='codeEditor'
|
||||||
language='gfm'
|
language='gfm'
|
||||||
@@ -288,7 +283,6 @@ const Editor = createClass({
|
|||||||
}
|
}
|
||||||
if(this.isStyle()){
|
if(this.isStyle()){
|
||||||
return <>
|
return <>
|
||||||
{this.renderEditorCSSLink()}
|
|
||||||
<CodeEditor key='codeEditor'
|
<CodeEditor key='codeEditor'
|
||||||
ref='codeEditor'
|
ref='codeEditor'
|
||||||
language='css'
|
language='css'
|
||||||
|
|||||||
@@ -396,7 +396,10 @@ const CodeEditor = createClass({
|
|||||||
//----------------------//
|
//----------------------//
|
||||||
|
|
||||||
render : function(){
|
render : function(){
|
||||||
return <div className='codeEditor' ref='editor' style={this.props.style}/>;
|
return <>
|
||||||
|
<link href={`../homebrew/cm-themes/${this.props.editorTheme}.css`} rel='stylesheet' />
|
||||||
|
<div className='codeEditor' ref='editor' style={this.props.style}/>
|
||||||
|
</>;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user