0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-02 17:12:45 +00:00

Move Undo/Redo to SnippetBar

This commit is contained in:
G.Ambatte
2021-10-05 20:25:24 +13:00
parent fbabae8793
commit 96af13b71f
3 changed files with 34 additions and 17 deletions

View File

@@ -199,19 +199,16 @@ const Editor = createClass({
}
},
renderEditorToolbar : function(){
return <div className='editorToolbar'>
<span className='undo'
onClick={this.refs.codeEditor?.undo}
title='Undo'>
<i className='fas fa-undo' />
</span>
<span className='redo'
onClick={this.refs.codeEditor?.redo}
title='Redo'>
<i className='fas fa-redo' />
</span>
</div>;
redo : function(){
return this.refs.codeEditor?.redo();
},
historySize : function(){
return this.refs.codeEditor?.historySize();
},
undo : function(){
return this.refs.codeEditor?.undo();
},
render : function(){
@@ -224,10 +221,12 @@ const Editor = createClass({
onViewChange={this.handleViewChange}
onInject={this.handleInject}
showEditButtons={this.props.showEditButtons}
renderer={this.props.renderer} />
renderer={this.props.renderer}
undo={this.undo}
redo={this.redo}
historySize={this.historySize} />
{this.renderEditor()}
{!this.isMeta() && this.renderEditorToolbar()}
</div>
);
}