From 010309b04f948e4ba4ff0d9ae5e159307cdf24d1 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Tue, 3 May 2022 13:36:27 +1200 Subject: [PATCH] Add `toTop` button to SnippetBar --- client/homebrew/editor/snippetbar/snippetbar.jsx | 9 +++++++++ client/homebrew/editor/snippetbar/snippetbar.less | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/client/homebrew/editor/snippetbar/snippetbar.jsx b/client/homebrew/editor/snippetbar/snippetbar.jsx index 0c6b5cc38..2be9e4775 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.jsx +++ b/client/homebrew/editor/snippetbar/snippetbar.jsx @@ -60,10 +60,19 @@ const Snippetbar = createClass({ }); }, + toTop : function(){ + this.props.brewJump(1); + this.props.sourceJump(1); + }, + renderEditorButtons : function(){ if(!this.props.showEditButtons) return; return
+
+ +
diff --git a/client/homebrew/editor/snippetbar/snippetbar.less b/client/homebrew/editor/snippetbar/snippetbar.less index 371f51fda..fe374f594 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.less +++ b/client/homebrew/editor/snippetbar/snippetbar.less @@ -46,6 +46,14 @@ color : black; } } + &.toTop{ + .tooltipLeft('Back to Top'); + font-size : 0.75em; + color : grey; + &.active{ + color : black; + } + } &.divider { background: linear-gradient(#000, #000) no-repeat center/1px 100%; width: 5px;