mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-09-23 14:02:58 +00:00
Make snippet elements buttons so they can be interacted with a keyboard.
This commit is contained in:
@@ -246,53 +246,53 @@ const Snippetbar = createReactClass({
|
|||||||
return (
|
return (
|
||||||
<div className='editors'>
|
<div className='editors'>
|
||||||
{this.props.view !== 'meta' && <><div className='historyTools'>
|
{this.props.view !== 'meta' && <><div className='historyTools'>
|
||||||
<div className={`editorTool snippetGroup history ${this.state.historyExists ? 'active' : ''}`}
|
<button className={`editorTool snippetGroup history ${this.state.historyExists ? 'active' : ''}`}
|
||||||
onClick={this.toggleHistoryMenu} >
|
onClick={this.toggleHistoryMenu} >
|
||||||
<i className='fas fa-clock-rotate-left' />
|
<i className='fas fa-clock-rotate-left' />
|
||||||
{ this.state.showHistory && this.renderHistoryItems() }
|
{ this.state.showHistory && this.renderHistoryItems() }
|
||||||
</div>
|
</button>
|
||||||
<div className={`editorTool undo ${this.props.historySize.done ? 'active' : ''}`}
|
<button className={`editorTool undo ${this.props.historySize.done ? 'active' : ''}`}
|
||||||
onClick={this.props.undo} >
|
onClick={this.props.undo} >
|
||||||
<i className='fas fa-undo' />
|
<i className='fas fa-undo' />
|
||||||
</div>
|
</button>
|
||||||
<div className={`editorTool redo ${this.props.historySize.undone ? 'active' : ''}`}
|
<button className={`editorTool redo ${this.props.historySize.undone ? 'active' : ''}`}
|
||||||
onClick={this.props.redo} >
|
onClick={this.props.redo} >
|
||||||
<i className='fas fa-redo' />
|
<i className='fas fa-redo' />
|
||||||
</div>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className='codeTools'>
|
<div className='codeTools'>
|
||||||
<div className={`editorTool foldAll ${this.props.foldCode ? 'active' : ''}`}
|
<button className={`editorTool foldAll ${this.props.foldCode ? 'active' : ''}`}
|
||||||
onClick={this.props.foldCode} >
|
onClick={this.props.foldCode} >
|
||||||
<i className='fas fa-compress-alt' />
|
<i className='fas fa-compress-alt' />
|
||||||
</div>
|
</button>
|
||||||
<div className={`editorTool unfoldAll ${this.props.unfoldCode ? 'active' : ''}`}
|
<button className={`editorTool unfoldAll ${this.props.unfoldCode ? 'active' : ''}`}
|
||||||
onClick={this.props.unfoldCode} >
|
onClick={this.props.unfoldCode} >
|
||||||
<i className='fas fa-expand-alt' />
|
<i className='fas fa-expand-alt' />
|
||||||
</div>
|
</button>
|
||||||
<div className={`editorTheme ${this.state.themeSelector ? 'active' : ''}`}
|
<button className={`editorTheme ${this.state.themeSelector ? 'active' : ''}`}
|
||||||
onClick={this.toggleThemeSelector} >
|
onClick={this.toggleThemeSelector} >
|
||||||
<i className='fas fa-palette' />
|
<i className='fas fa-palette' />
|
||||||
{this.state.themeSelector && this.renderThemeSelector()}
|
{this.state.themeSelector && this.renderThemeSelector()}
|
||||||
</div>
|
</button>
|
||||||
</div></>}
|
</div></>}
|
||||||
|
|
||||||
<div className='tabs'>
|
<div className='tabs'>
|
||||||
<div className={cx('text', { selected: this.props.view === 'text' })}
|
<button className={cx('text', { selected: this.props.view === 'text' })}
|
||||||
onClick={()=>this.props.onViewChange('text')}>
|
onClick={()=>this.props.onViewChange('text')}>
|
||||||
<i className='fa fa-beer' />
|
<i className='fa fa-beer' />
|
||||||
</div>
|
</button>
|
||||||
<div className={cx('style', { selected: this.props.view === 'style' })}
|
<button className={cx('style', { selected: this.props.view === 'style' })}
|
||||||
onClick={()=>this.props.onViewChange('style')}>
|
onClick={()=>this.props.onViewChange('style')}>
|
||||||
<i className='fa fa-paint-brush' />
|
<i className='fa fa-paint-brush' />
|
||||||
</div>
|
</button>
|
||||||
<div className={cx('snippet', { selected: this.props.view === 'snippet' })}
|
<button className={cx('snippet', { selected: this.props.view === 'snippet' })}
|
||||||
onClick={()=>this.props.onViewChange('snippet')}>
|
onClick={()=>this.props.onViewChange('snippet')}>
|
||||||
<i className='fas fa-th-list' />
|
<i className='fas fa-th-list' />
|
||||||
</div>
|
</button>
|
||||||
<div className={cx('meta', { selected: this.props.view === 'meta' })}
|
<button className={cx('meta', { selected: this.props.view === 'meta' })}
|
||||||
onClick={()=>this.props.onViewChange('meta')}>
|
onClick={()=>this.props.onViewChange('meta')}>
|
||||||
<i className='fas fa-info-circle' />
|
<i className='fas fa-info-circle' />
|
||||||
</div>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
position : relative;
|
position : relative;
|
||||||
display : flex;
|
display : flex;
|
||||||
flex-wrap : wrap-reverse;
|
flex-wrap : wrap-reverse;
|
||||||
|
reading-flow : flex-visual;
|
||||||
justify-content : space-between;
|
justify-content : space-between;
|
||||||
height : auto;
|
height : auto;
|
||||||
color : black;
|
color : black;
|
||||||
@@ -24,6 +25,7 @@
|
|||||||
min-width : 250px; //must be controlled every time an item is added, must be hardcoded for the wrapping as it is applied
|
min-width : 250px; //must be controlled every time an item is added, must be hardcoded for the wrapping as it is applied
|
||||||
font-size: .85rem;
|
font-size: .85rem;
|
||||||
&:only-child {min-width : unset; margin-left : auto;}
|
&:only-child {min-width : unset; margin-left : auto;}
|
||||||
|
reading-order : 2;
|
||||||
|
|
||||||
>div {
|
>div {
|
||||||
display : flex;
|
display : flex;
|
||||||
@@ -32,7 +34,7 @@
|
|||||||
|
|
||||||
&:first-child { border-left : none; }
|
&:first-child { border-left : none; }
|
||||||
|
|
||||||
& > div {
|
& > button {
|
||||||
position : relative;
|
position : relative;
|
||||||
width : @menuHeight;
|
width : @menuHeight;
|
||||||
height : @menuHeight;
|
height : @menuHeight;
|
||||||
@@ -127,6 +129,7 @@
|
|||||||
display : flex;
|
display : flex;
|
||||||
justify-content : flex-start;
|
justify-content : flex-start;
|
||||||
min-width : 565.95px; //must be controlled every time an item is added, must be hardcoded for the wrapping as it is applied
|
min-width : 565.95px; //must be controlled every time an item is added, must be hardcoded for the wrapping as it is applied
|
||||||
|
reading-order : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// removed caret for top level items, by request (makes buttons too wide).
|
// removed caret for top level items, by request (makes buttons too wide).
|
||||||
@@ -214,10 +217,12 @@
|
|||||||
flex : 1;
|
flex : 1;
|
||||||
justify-content : space-between;
|
justify-content : space-between;
|
||||||
border-bottom : 1px solid;
|
border-bottom : 1px solid;
|
||||||
|
reading-order : 1;
|
||||||
}
|
}
|
||||||
.snippets {
|
.snippets {
|
||||||
flex : 1;
|
flex : 1;
|
||||||
justify-content : space-evenly;
|
justify-content : space-evenly;
|
||||||
|
reading-order : 2;
|
||||||
}
|
}
|
||||||
.editors > div.history > .dropdown { right : unset; }
|
.editors > div.history > .dropdown { right : unset; }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user