0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 18:32:41 +00:00

Add moveBrew and moveSource function calls

This commit is contained in:
G.Ambatte
2022-05-03 22:33:05 +12:00
parent 7034f1d2d5
commit af3a403971
2 changed files with 34 additions and 2 deletions

View File

@@ -61,18 +61,34 @@ const Snippetbar = createClass({
},
toTop : function(){
this.props.sourceJump(0);
this.props.brewJump(1);
this.props.sourceJump(1);
},
moveBrew : function(){
this.props.brewJump();
},
moveSource : function(){
this.props.sourceJump();
},
renderEditorButtons : function(){
if(!this.props.showEditButtons) return;
return <div className='editors'>
<div className={`editorTool fromBrew ${['text'].includes(this.props.view) ? 'active' : ''}`}
onClick={this.moveSource} >
<i className='fas fa-arrow-left' />
</div>
<div className={`editorTool toTop ${['text', 'style'].includes(this.props.view) ? 'active' : ''}`}
onClick={this.toTop} >
<i className='fas fa-arrow-up' />
</div>
<div className={`editorTool toBrew ${['text'].includes(this.props.view) ? 'active' : ''}`}
onClick={this.moveBrew} >
<i className='fas fa-arrow-right' />
</div>
<div className={`editorTool undo ${this.props.historySize.undo ? 'active' : ''}`}
onClick={this.props.undo} >
<i className='fas fa-undo' />

View File

@@ -10,7 +10,7 @@
top : 0px;
right : 0px;
height : @menuHeight;
width : 125px;
width : 175px;
justify-content : space-between;
&>div{
height : @menuHeight;
@@ -54,6 +54,22 @@
color : black;
}
}
&.toBrew{
.tooltipLeft('Match Brew to Source');
font-size : 0.75em;
color : grey;
&.active{
color : black;
}
}
&.fromBrew{
.tooltipLeft('Match Source to Brew');
font-size : 0.75em;
color : grey;
&.active{
color : black;
}
}
&.divider {
background: linear-gradient(#000, #000) no-repeat center/1px 100%;
width: 5px;