mirror of
https://github.com/go-gitea/gitea.git
synced 2024-11-04 08:17:24 -05:00
Hide branch/tag icon if branches/tags are empty (#26204)
The branch/tag icons aren't hidden correctly if there is no branch/tag. This PR fixes it.
This commit is contained in:
parent
7866a6e0e2
commit
d88fed0db1
@ -16,7 +16,7 @@ async function loadBranchesAndTags(area, loadingButton) {
|
|||||||
|
|
||||||
function addTags(area, tags) {
|
function addTags(area, tags) {
|
||||||
const tagArea = area.querySelector('.tag-area');
|
const tagArea = area.querySelector('.tag-area');
|
||||||
toggleElem(tagArea, tags.length > 0);
|
toggleElem(tagArea.parentElement, tags.length > 0);
|
||||||
for (const tag of tags) {
|
for (const tag of tags) {
|
||||||
addLink(tagArea, tag.web_link, tag.name);
|
addLink(tagArea, tag.web_link, tag.name);
|
||||||
}
|
}
|
||||||
@ -25,7 +25,7 @@ function addTags(area, tags) {
|
|||||||
function addBranches(area, branches, defaultBranch) {
|
function addBranches(area, branches, defaultBranch) {
|
||||||
const defaultBranchTooltip = area.getAttribute('data-text-default-branch-tooltip');
|
const defaultBranchTooltip = area.getAttribute('data-text-default-branch-tooltip');
|
||||||
const branchArea = area.querySelector('.branch-area');
|
const branchArea = area.querySelector('.branch-area');
|
||||||
toggleElem(branchArea, branches.length > 0);
|
toggleElem(branchArea.parentElement, branches.length > 0);
|
||||||
for (const branch of branches) {
|
for (const branch of branches) {
|
||||||
const tooltip = defaultBranch === branch.name ? defaultBranchTooltip : null;
|
const tooltip = defaultBranch === branch.name ? defaultBranchTooltip : null;
|
||||||
addLink(branchArea, branch.web_link, branch.name, tooltip);
|
addLink(branchArea, branch.web_link, branch.name, tooltip);
|
||||||
|
Loading…
Reference in New Issue
Block a user