mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-11 04:42:42 +00:00
change tab
This commit is contained in:
@@ -61,7 +61,7 @@ const Editor = createClass({
|
|||||||
getInitialState : function() {
|
getInitialState : function() {
|
||||||
return {
|
return {
|
||||||
editorTheme : this.props.editorTheme,
|
editorTheme : this.props.editorTheme,
|
||||||
view : 'text' //'text', 'style', 'meta', 'snip'
|
view : 'text' //'text', 'style', 'meta', 'snippet'
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ const Editor = createClass({
|
|||||||
isText : function() {return this.state.view == 'text';},
|
isText : function() {return this.state.view == 'text';},
|
||||||
isStyle : function() {return this.state.view == 'style';},
|
isStyle : function() {return this.state.view == 'style';},
|
||||||
isMeta : function() {return this.state.view == 'meta';},
|
isMeta : function() {return this.state.view == 'meta';},
|
||||||
isSnip : function() {return this.state.view == 'snip';},
|
isSnip : function() {return this.state.view == 'snippet';},
|
||||||
|
|
||||||
componentDidMount : function() {
|
componentDidMount : function() {
|
||||||
|
|
||||||
@@ -167,7 +167,7 @@ const Editor = createClass({
|
|||||||
|
|
||||||
highlightCustomMarkdown : function(){
|
highlightCustomMarkdown : function(){
|
||||||
if(!this.codeEditor.current) return;
|
if(!this.codeEditor.current) return;
|
||||||
if((this.state.view === 'text') ||(this.state.view === 'snip')) {
|
if((this.state.view === 'text') ||(this.state.view === 'snippet')) {
|
||||||
const codeMirror = this.codeEditor.current.codeMirror;
|
const codeMirror = this.codeEditor.current.codeMirror;
|
||||||
|
|
||||||
codeMirror.operation(()=>{ // Batch CodeMirror styling
|
codeMirror.operation(()=>{ // Batch CodeMirror styling
|
||||||
|
|||||||
@@ -259,8 +259,8 @@ const Snippetbar = createClass({
|
|||||||
onClick={()=>this.props.onViewChange('style')}>
|
onClick={()=>this.props.onViewChange('style')}>
|
||||||
<i className='fa fa-paint-brush' />
|
<i className='fa fa-paint-brush' />
|
||||||
</div>
|
</div>
|
||||||
<div className={cx('snip', { selected: this.props.view === 'snip' })}
|
<div className={cx('snippet', { selected: this.props.view === 'snippet' })}
|
||||||
onClick={()=>this.props.onViewChange('snip')}>
|
onClick={()=>this.props.onViewChange('snippet')}>
|
||||||
<i className='fas fa-th-list' />
|
<i className='fas fa-th-list' />
|
||||||
</div>
|
</div>
|
||||||
<div className={cx('meta', { selected: this.props.view === 'meta' })}
|
<div className={cx('meta', { selected: this.props.view === 'meta' })}
|
||||||
|
|||||||
Reference in New Issue
Block a user