Skip to content

Commit 717ca9b

Browse files
committed
Refresh button added to Remote Branches section that prunes refs to deleted remote branches.
1 parent 9d65a6e commit 717ca9b

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

git-webui/release/share/git-webui/webui/css/git-webui.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ body {
7878
flex-direction: column;
7979
-webkit-flex-direction: column;
8080
padding: 0 0.5% 0 0.5%;
81-
width: 17em;
81+
width: 18em;
8282
background-color: #333333;
8383
}
8484
#sidebar #sidebar-logo {
@@ -214,7 +214,7 @@ body {
214214
border-radius: .2rem;
215215
}
216216

217-
.btn-add {
217+
.btn-sidebar-icon {
218218
padding: 0% 0% 2% 5%;
219219
}
220220

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

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,14 +370,20 @@ webui.SideBarView = function(mainView) {
370370
'</section>' +
371371
'<section id="sidebar-local-branches">' +
372372
'<h4 class="mt-3">Local Branches' +
373-
'<button type="button" class="btn btn-default btn-add" >' +
373+
'<button type="button" class="btn btn-default btn-sidebar-icon btn-add" >' +
374374
'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#eee" class="bi bi-plus-circle-fill" viewBox="0 0 16 16">'+
375375
'<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8.5 4.5a.5.5 0 0 0-1 0v3h-3a.5.5 0 0 0 0 1h3v3a.5.5 0 0 0 1 0v-3h3a.5.5 0 0 0 0-1h-3v-3z"/>'+
376376
'</svg>'+
377377
'</button>' + '</h4>' +
378378
'</section>' +
379379
'<section id="sidebar-remote-branches">' +
380-
'<h4 class="mt-3">Remote Branches</h4>' +
380+
'<h4 class="mt-3">Remote Branches' +
381+
'<button type="button" class="btn btn-default btn-sidebar-icon btn-prune-remote-branches" >'+
382+
'<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" fill="#eee" class="bi bi-arrow-repeat" viewBox="0 0 16 16">'+
383+
'<path d="M11.534 7h3.932a.25.25 0 0 1 .192.41l-1.966 2.36a.25.25 0 0 1-.384 0l-1.966-2.36a.25.25 0 0 1 .192-.41zm-11 2h3.932a.25.25 0 0 0 .192-.41L2.692 6.23a.25.25 0 0 0-.384 0L.342 8.59A.25.25 0 0 0 .534 9z"/>'+
384+
'<path fill-rule="evenodd" d="M8 3c-1.552 0-2.94.707-3.857 1.818a.5.5 0 1 1-.771-.636A6.002 6.002 0 0 1 13.917 7H12.9A5.002 5.002 0 0 0 8 3zM3.1 9a5.002 5.002 0 0 0 8.757 2.182.5.5 0 1 1 .771.636A6.002 6.002 0 0 1 2.083 9H3.1z"/>'+
385+
'</svg>'+
386+
'</button>' +'</h4>' +
381387
'</section>' +
382388
'<section id="sidebar-tags">' +
383389
'<h4>Tags</h4>' +
@@ -1839,6 +1845,13 @@ $(function()
18391845
webui.git("checkout -b " + $('#newBranchName').val());
18401846
updateSideBar();
18411847
});
1848+
1849+
$(document).on('click', '.btn-sidebar-icon', function(e){
1850+
e.preventDefault();
1851+
webui.git("fetch --prune", function() {
1852+
updateSideBar();
1853+
});
1854+
})
18421855
});
18431856

18441857
$(function () {

0 commit comments

Comments
 (0)