0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-05 21:02:43 +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(){ toTop : function(){
this.props.sourceJump(0);
this.props.brewJump(1); this.props.brewJump(1);
this.props.sourceJump(1); },
moveBrew : function(){
this.props.brewJump();
},
moveSource : function(){
this.props.sourceJump();
}, },
renderEditorButtons : function(){ renderEditorButtons : function(){
if(!this.props.showEditButtons) return; if(!this.props.showEditButtons) return;
return <div className='editors'> 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' : ''}`} <div className={`editorTool toTop ${['text', 'style'].includes(this.props.view) ? 'active' : ''}`}
onClick={this.toTop} > onClick={this.toTop} >
<i className='fas fa-arrow-up' /> <i className='fas fa-arrow-up' />
</div> </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' : ''}`} <div className={`editorTool undo ${this.props.historySize.undo ? 'active' : ''}`}
onClick={this.props.undo} > onClick={this.props.undo} >
<i className='fas fa-undo' /> <i className='fas fa-undo' />

View File

@@ -10,7 +10,7 @@
top : 0px; top : 0px;
right : 0px; right : 0px;
height : @menuHeight; height : @menuHeight;
width : 125px; width : 175px;
justify-content : space-between; justify-content : space-between;
&>div{ &>div{
height : @menuHeight; height : @menuHeight;
@@ -54,6 +54,22 @@
color : black; 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 { &.divider {
background: linear-gradient(#000, #000) no-repeat center/1px 100%; background: linear-gradient(#000, #000) no-repeat center/1px 100%;
width: 5px; width: 5px;