diff --git a/client/homebrew/editor/editor.jsx b/client/homebrew/editor/editor.jsx index 95bb68447..82435cacb 100644 --- a/client/homebrew/editor/editor.jsx +++ b/client/homebrew/editor/editor.jsx @@ -199,19 +199,16 @@ const Editor = createClass({ } }, - renderEditorToolbar : function(){ - return
- - - - - - -
; + 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()} ); } diff --git a/client/homebrew/editor/snippetbar/snippetbar.jsx b/client/homebrew/editor/snippetbar/snippetbar.jsx index 9ea04695f..8f0ee9607 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.jsx +++ b/client/homebrew/editor/snippetbar/snippetbar.jsx @@ -22,7 +22,9 @@ const Snippetbar = createClass({ onInject : ()=>{}, onToggle : ()=>{}, showEditButtons : true, - renderer : 'legacy' + renderer : 'legacy', + undo : ()=>{}, + redo : ()=>{} }; }, @@ -60,6 +62,14 @@ const Snippetbar = createClass({ if(!this.props.showEditButtons) return; return
+
+ +
+
+ +
this.props.onViewChange('text')}> diff --git a/client/homebrew/editor/snippetbar/snippetbar.less b/client/homebrew/editor/snippetbar/snippetbar.less index ae8962501..51e832174 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.less +++ b/client/homebrew/editor/snippetbar/snippetbar.less @@ -10,7 +10,7 @@ top : 0px; right : 0px; height : @menuHeight; - width : 90px; + width : 125px; justify-content : space-between; &>div{ height : @menuHeight; @@ -30,6 +30,14 @@ &.meta{ .tooltipLeft('Properties'); } + &.undo{ + .tooltipLeft('Undo'); + font-size : 0.75em; + } + &.redo{ + .tooltipLeft('Redo'); + font-size : 0.75em; + } } } .snippetBarButton{