mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-11 11:12:44 +00:00
Hide divider arrows when not required
This commit is contained in:
@@ -232,6 +232,7 @@ const Editor = createClass({
|
|||||||
|
|
||||||
renderEditor : function(){
|
renderEditor : function(){
|
||||||
if(this.isText()){
|
if(this.isText()){
|
||||||
|
this.props.setMoveArrows(true);
|
||||||
return <>
|
return <>
|
||||||
<CodeEditor key='codeEditor'
|
<CodeEditor key='codeEditor'
|
||||||
ref='codeEditor'
|
ref='codeEditor'
|
||||||
@@ -243,6 +244,7 @@ const Editor = createClass({
|
|||||||
</>;
|
</>;
|
||||||
}
|
}
|
||||||
if(this.isStyle()){
|
if(this.isStyle()){
|
||||||
|
this.props.setMoveArrows(false);
|
||||||
return <>
|
return <>
|
||||||
<CodeEditor key='codeEditor'
|
<CodeEditor key='codeEditor'
|
||||||
ref='codeEditor'
|
ref='codeEditor'
|
||||||
@@ -255,6 +257,7 @@ const Editor = createClass({
|
|||||||
</>;
|
</>;
|
||||||
}
|
}
|
||||||
if(this.isMeta()){
|
if(this.isMeta()){
|
||||||
|
this.props.setMoveArrows(false);
|
||||||
return <>
|
return <>
|
||||||
<CodeEditor key='codeEditor'
|
<CodeEditor key='codeEditor'
|
||||||
view={this.state.view}
|
view={this.state.view}
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ const SplitPane = createClass({
|
|||||||
windowWidth : 0,
|
windowWidth : 0,
|
||||||
isDragging : false,
|
isDragging : false,
|
||||||
moveSource : false,
|
moveSource : false,
|
||||||
moveBrew : false
|
moveBrew : false,
|
||||||
|
showMoveArrows : true
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -91,7 +92,16 @@ const SplitPane = createClass({
|
|||||||
},
|
},
|
||||||
*/
|
*/
|
||||||
|
|
||||||
renderDivider : function(){
|
setMoveArrows : function(newState) {
|
||||||
|
if(this.state.showMoveArrows != newState){
|
||||||
|
this.setState({
|
||||||
|
showMoveArrows : newState
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
renderMoveArrows : function(){
|
||||||
|
if(this.state.showMoveArrows) {
|
||||||
return <>
|
return <>
|
||||||
<div className='arrow left'
|
<div className='arrow left'
|
||||||
style={{ left: this.state.currentDividerPos-4 }}
|
style={{ left: this.state.currentDividerPos-4 }}
|
||||||
@@ -103,6 +113,13 @@ const SplitPane = createClass({
|
|||||||
onClick={()=>this.setState({ moveBrew: !this.state.moveBrew })} >
|
onClick={()=>this.setState({ moveBrew: !this.state.moveBrew })} >
|
||||||
<i className='fas fa-arrow-right' />
|
<i className='fas fa-arrow-right' />
|
||||||
</div>
|
</div>
|
||||||
|
</>;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
renderDivider : function(){
|
||||||
|
return <>
|
||||||
|
{this.renderMoveArrows()}
|
||||||
<div className='divider' onMouseDown={this.handleDown} >
|
<div className='divider' onMouseDown={this.handleDown} >
|
||||||
<div className='dots'>
|
<div className='dots'>
|
||||||
<i className='fas fa-circle' />
|
<i className='fas fa-circle' />
|
||||||
@@ -121,7 +138,8 @@ const SplitPane = createClass({
|
|||||||
>
|
>
|
||||||
{React.cloneElement(this.props.children[0], {
|
{React.cloneElement(this.props.children[0], {
|
||||||
moveBrew : this.state.moveBrew,
|
moveBrew : this.state.moveBrew,
|
||||||
moveSource : this.state.moveSource
|
moveSource : this.state.moveSource,
|
||||||
|
setMoveArrows : this.setMoveArrows
|
||||||
})}
|
})}
|
||||||
</Pane>
|
</Pane>
|
||||||
{this.renderDivider()}
|
{this.renderDivider()}
|
||||||
|
|||||||
Reference in New Issue
Block a user