Skip to content

Commit d46e0be

Browse files
committed
feat: now shows current context on sidebar button hover
1 parent d9766b9 commit d46e0be

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [2.4.1] - Unreleased
8+
## [2.5.0] - Unreleased
9+
10+
### Added
11+
- New way to change context of Git-Source-Control from UI (#280)
12+
13+
## [2.4.1] - 2024-08-02
914

1015
### Added
1116
- New API endpoint that accepts git commands as array instead of string (#437)

git-webui/release/share/git-webui/webui/js/git-webui.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,7 @@ webui.SideBarView = function(mainView, noEventHandlers) {
948948
};
949949

950950
self.mainView = mainView;
951-
951+
self.currentContext = self.getCurrentContext();
952952
self.element = $( '<div id="sidebar">' +
953953
'<a href="#" data-toggle="modal" data-target="#help-modal"><img id="sidebar-logo" src="img/git-logo.png"></a>' +
954954
'<h5 id="packageVersion"></h5>' +
@@ -974,7 +974,7 @@ webui.SideBarView = function(mainView, noEventHandlers) {
974974
'<section id="sidebar-tags">' +
975975
'<h4>Tags</h4>' +
976976
'</section>' +
977-
'<section id="sidebar-context" data-toggle="tooltip" data-placement="right" title="Current Context">' +
977+
'<section id="sidebar-context" data-toggle="tooltip" data-placement="right" title="' + self.currentContext + '">' +
978978
'<h4>Change Context</h4>' +
979979
'</section>' +
980980
'<section id="sidebar-settings">' +
@@ -1006,7 +1006,7 @@ webui.SideBarView = function(mainView, noEventHandlers) {
10061006
$("#sidebar-context", self.element).click(self.changeContextGet);
10071007
}
10081008

1009-
self.currentContext = self.getCurrentContext();
1009+
10101010
self.getPackageVersion();
10111011
self.fetchSection($("#sidebar-local-branches", self.element)[0], "Local Branches", "local-branches", "branch --verbose --verbose");
10121012
self.fetchSection($("#sidebar-remote-branches", self.element)[0], "Remote Branches", "remote-branches", "branch --remotes");

git-webui/src/share/git-webui/webui/js/git-webui.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,7 @@ webui.SideBarView = function(mainView, noEventHandlers) {
948948
};
949949

950950
self.mainView = mainView;
951-
951+
self.currentContext = self.getCurrentContext();
952952
self.element = $( '<div id="sidebar">' +
953953
'<a href="#" data-toggle="modal" data-target="#help-modal"><img id="sidebar-logo" src="img/git-logo.png"></a>' +
954954
'<h5 id="packageVersion"></h5>' +
@@ -974,7 +974,7 @@ webui.SideBarView = function(mainView, noEventHandlers) {
974974
'<section id="sidebar-tags">' +
975975
'<h4>Tags</h4>' +
976976
'</section>' +
977-
'<section id="sidebar-context" data-toggle="tooltip" data-placement="right" title="Current Context">' +
977+
'<section id="sidebar-context" data-toggle="tooltip" data-placement="right" title="' + self.currentContext + '">' +
978978
'<h4>Change Context</h4>' +
979979
'</section>' +
980980
'<section id="sidebar-settings">' +
@@ -1006,7 +1006,7 @@ webui.SideBarView = function(mainView, noEventHandlers) {
10061006
$("#sidebar-context", self.element).click(self.changeContextGet);
10071007
}
10081008

1009-
self.currentContext = self.getCurrentContext();
1009+
10101010
self.getPackageVersion();
10111011
self.fetchSection($("#sidebar-local-branches", self.element)[0], "Local Branches", "local-branches", "branch --verbose --verbose");
10121012
self.fetchSection($("#sidebar-remote-branches", self.element)[0], "Remote Branches", "remote-branches", "branch --remotes");

0 commit comments

Comments
 (0)