From 092b3cb23ab08e2c57c30432640ffef238b9c8fc Mon Sep 17 00:00:00 2001 From: isc-vgao Date: Tue, 2 Jan 2024 14:23:12 -0500 Subject: [PATCH] show longest remote branch name --- .../release/share/git-webui/webui/css/git-webui.css | 6 +++++- .../release/share/git-webui/webui/js/git-webui.js | 12 +++++++++++- .../src/share/git-webui/webui/css/git-webui.less | 6 +++++- git-webui/src/share/git-webui/webui/js/git-webui.js | 12 +++++++++++- 4 files changed, 32 insertions(+), 4 deletions(-) diff --git a/git-webui/release/share/git-webui/webui/css/git-webui.css b/git-webui/release/share/git-webui/webui/css/git-webui.css index 0e228602..e921a187 100644 --- a/git-webui/release/share/git-webui/webui/css/git-webui.css +++ b/git-webui/release/share/git-webui/webui/css/git-webui.css @@ -265,7 +265,7 @@ body { border: none; } .modal .card-header { - padding: 1% 2% 0% 14%; + padding: 0; background-color: #fff; color: inherit !important; border: none !important; @@ -277,6 +277,10 @@ body { padding-bottom: 1%; margin: 0%; border: none !important; + overflow: visible; +} +.modal .modal-content { + min-width: fit-content; } #main-view { display: flex; diff --git a/git-webui/release/share/git-webui/webui/js/git-webui.js b/git-webui/release/share/git-webui/webui/js/git-webui.js index 9b67eaf9..0de81f33 100644 --- a/git-webui/release/share/git-webui/webui/js/git-webui.js +++ b/git-webui/release/share/git-webui/webui/js/git-webui.js @@ -362,7 +362,7 @@ webui.SideBarView = function(mainView, noEventHandlers) { var itemId = refname + idPostfix; var cardHeader = $('
').appendTo(cardDiv); var button = $('').appendTo(cardHeader) var collapseDiv = $('
').appendTo(cardDiv); @@ -377,6 +377,16 @@ webui.SideBarView = function(mainView, noEventHandlers) { self.selectRef(event.target.innerHTML); }); } + + if (id === "remote-branches" && idPostfix === "popup") { + const remoteBranchBtns = $("#accordion-remote-branches-popup button").filter((i, span) => jQuery.inArray($(span).text(),refs) != -1); + const widest = Math.max(...remoteBranchBtns.map((i, span) => $(span).width())); + if (remoteBranchBtns.length > 0) { + remoteBranchBtns.css("padding", ".25rem .5rem"); + remoteBranchBtns.css("border", 0); + remoteBranchBtns.width(widest); + } + } return accordionDiv; } diff --git a/git-webui/src/share/git-webui/webui/css/git-webui.less b/git-webui/src/share/git-webui/webui/css/git-webui.less index 9a3c1535..3a788b60 100644 --- a/git-webui/src/share/git-webui/webui/css/git-webui.less +++ b/git-webui/src/share/git-webui/webui/css/git-webui.less @@ -361,7 +361,7 @@ body { .modal { .card-header { - padding: 1% 2% 0% 14%; + padding: 0; background-color: #fff; color: inherit !important; border:none !important; @@ -372,6 +372,10 @@ body { padding-bottom:1%; margin: 0%; border: none !important; + overflow: visible; + } + .modal-content { + min-width: fit-content; } } diff --git a/git-webui/src/share/git-webui/webui/js/git-webui.js b/git-webui/src/share/git-webui/webui/js/git-webui.js index 9b67eaf9..0de81f33 100644 --- a/git-webui/src/share/git-webui/webui/js/git-webui.js +++ b/git-webui/src/share/git-webui/webui/js/git-webui.js @@ -362,7 +362,7 @@ webui.SideBarView = function(mainView, noEventHandlers) { var itemId = refname + idPostfix; var cardHeader = $('
').appendTo(cardDiv); var button = $('').appendTo(cardHeader) var collapseDiv = $('
').appendTo(cardDiv); @@ -377,6 +377,16 @@ webui.SideBarView = function(mainView, noEventHandlers) { self.selectRef(event.target.innerHTML); }); } + + if (id === "remote-branches" && idPostfix === "popup") { + const remoteBranchBtns = $("#accordion-remote-branches-popup button").filter((i, span) => jQuery.inArray($(span).text(),refs) != -1); + const widest = Math.max(...remoteBranchBtns.map((i, span) => $(span).width())); + if (remoteBranchBtns.length > 0) { + remoteBranchBtns.css("padding", ".25rem .5rem"); + remoteBranchBtns.css("border", 0); + remoteBranchBtns.width(widest); + } + } return accordionDiv; }