mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-30 08:52:38 +00:00
Merge branch 'master' into pr/3203
This commit is contained in:
@@ -74,6 +74,7 @@ const Snippetbar = createClass({
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
mergeCustomizer : function(valueA, valueB, key) {
|
||||
if(key == 'snippets') {
|
||||
const result = _.reverse(_.unionBy(_.reverse(valueB), _.reverse(valueA), 'name')); // Join snippets together, with preference for the current theme over the base theme
|
||||
@@ -102,10 +103,12 @@ const Snippetbar = createClass({
|
||||
this.props.onInject(injectedText);
|
||||
},
|
||||
|
||||
toggleThemeSelector : function(){
|
||||
this.setState({
|
||||
themeSelector : !this.state.themeSelector
|
||||
});
|
||||
toggleThemeSelector : function(e){
|
||||
if(e.target.tagName != 'SELECT'){
|
||||
this.setState({
|
||||
themeSelector : !this.state.themeSelector
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
changeTheme : function(e){
|
||||
@@ -119,7 +122,7 @@ const Snippetbar = createClass({
|
||||
|
||||
renderThemeSelector : function(){
|
||||
return <div className='themeSelector'>
|
||||
<select value={this.props.currentEditorTheme} onChange={this.changeTheme} onMouseDown={(this.changeTheme)}>
|
||||
<select value={this.props.currentEditorTheme} onChange={this.changeTheme} >
|
||||
{EditorThemes.map((theme, key)=>{
|
||||
return <option key={key} value={theme}>{theme}</option>;
|
||||
})}
|
||||
@@ -176,8 +179,9 @@ const Snippetbar = createClass({
|
||||
<div className={`editorTool editorTheme ${this.state.themeSelector ? 'active' : ''}`}
|
||||
onClick={this.toggleThemeSelector} >
|
||||
<i className='fas fa-palette' />
|
||||
{this.state.themeSelector && this.renderThemeSelector()}
|
||||
</div>
|
||||
{this.state.themeSelector && this.renderThemeSelector()}
|
||||
|
||||
<div className='divider'></div>
|
||||
<div className={cx('text', { selected: this.props.view === 'text' })}
|
||||
onClick={()=>this.props.onViewChange('text')}>
|
||||
|
||||
@@ -1,26 +1,28 @@
|
||||
@import (less) './client/icons/customIcons.less';
|
||||
@import (less) '././././themes/fonts/5e/fonts.less';
|
||||
|
||||
.snippetBar {
|
||||
@menuHeight : 25px;
|
||||
position: relative;
|
||||
height: @menuHeight;
|
||||
background-color: #ddd;
|
||||
.editors {
|
||||
position: absolute;
|
||||
display: flex;
|
||||
top: 0px;
|
||||
right: 0px;
|
||||
height: @menuHeight;
|
||||
justify-content: space-between;
|
||||
&>div {
|
||||
height: @menuHeight;
|
||||
width: @menuHeight;
|
||||
cursor: pointer;
|
||||
line-height: @menuHeight;
|
||||
text-align: center;
|
||||
&:hover, &.selected {
|
||||
background-color: #999;
|
||||
.snippetBar{
|
||||
@menuHeight : 25px;
|
||||
position : relative;
|
||||
height : @menuHeight;
|
||||
background-color : #ddd;
|
||||
color : black;
|
||||
|
||||
.editors{
|
||||
position : absolute;
|
||||
display : flex;
|
||||
top : 0px;
|
||||
right : 0px;
|
||||
height : @menuHeight;
|
||||
justify-content : space-between;
|
||||
&>div{
|
||||
height : @menuHeight;
|
||||
width : @menuHeight;
|
||||
cursor : pointer;
|
||||
line-height : @menuHeight;
|
||||
text-align : center;
|
||||
&:hover,&.selected{
|
||||
background-color : #999;
|
||||
}
|
||||
&.text {
|
||||
.tooltipLeft('Brew Editor');
|
||||
@@ -33,47 +35,41 @@
|
||||
}
|
||||
&.undo {
|
||||
.tooltipLeft('Undo');
|
||||
font-size: 0.75em;
|
||||
color: grey;
|
||||
&.active {
|
||||
color: black;
|
||||
font-size : 0.75em;
|
||||
color : grey;
|
||||
&.active{
|
||||
color : inherit;
|
||||
}
|
||||
}
|
||||
&.redo {
|
||||
.tooltipLeft('Redo');
|
||||
font-size: 0.75em;
|
||||
color: grey;
|
||||
&.active {
|
||||
color: black;
|
||||
font-size : 0.75em;
|
||||
color : grey;
|
||||
&.active{
|
||||
color : inherit;
|
||||
}
|
||||
}
|
||||
&.foldAll {
|
||||
.tooltipLeft('Fold All');
|
||||
font-size: 0.75em;
|
||||
color: grey;
|
||||
&.active {
|
||||
color: black;
|
||||
}
|
||||
font-size : 0.75em;
|
||||
color : inherit;
|
||||
}
|
||||
&.unfoldAll {
|
||||
.tooltipLeft('Unfold All');
|
||||
font-size: 0.75em;
|
||||
color: grey;
|
||||
&.active {
|
||||
color: black;
|
||||
}
|
||||
font-size : 0.75em;
|
||||
color : inherit;
|
||||
}
|
||||
&.editorTheme {
|
||||
.tooltipLeft('Editor Themes');
|
||||
font-size: 0.75em;
|
||||
color: black;
|
||||
font-size : 0.75em;
|
||||
color : black;
|
||||
&.active {
|
||||
color: white;
|
||||
background-color: black;
|
||||
position : relative;
|
||||
background-color : #999;
|
||||
}
|
||||
}
|
||||
&.divider {
|
||||
background: linear-gradient(#000, #000) no-repeat center/1px 100%;
|
||||
background: linear-gradient(currentColor, currentColor) no-repeat center/1px 100%;
|
||||
width: 5px;
|
||||
&:hover {
|
||||
background-color: inherit;
|
||||
@@ -81,13 +77,16 @@
|
||||
}
|
||||
}
|
||||
.themeSelector {
|
||||
position: absolute;
|
||||
left: -65px;
|
||||
top: 30px;
|
||||
z-index: 999;
|
||||
width: 170px;
|
||||
background-color: black;
|
||||
border-radius: 5px;
|
||||
position : absolute;
|
||||
top : 25px;
|
||||
right : 0;
|
||||
z-index : 1;
|
||||
display : flex;
|
||||
align-items : center;
|
||||
justify-content : center;
|
||||
width : 170px;
|
||||
height : inherit;
|
||||
background-color : inherit;
|
||||
}
|
||||
}
|
||||
.snippetBarButton {
|
||||
@@ -115,11 +114,11 @@
|
||||
border-left: 1px solid black;
|
||||
.tooltipLeft("Edit Brew Properties");
|
||||
}
|
||||
.snippetGroup {
|
||||
border-right: 1px solid black;
|
||||
&:hover {
|
||||
&>.dropdown {
|
||||
visibility: visible;
|
||||
.snippetGroup{
|
||||
border-right : 1px solid currentColor;
|
||||
&:hover{
|
||||
&>.dropdown{
|
||||
visibility : visible;
|
||||
}
|
||||
}
|
||||
.dropdown {
|
||||
|
||||
Reference in New Issue
Block a user