Skip to content

Commit 97956cf

Browse files
committed
Fix formatting
1 parent b009c77 commit 97956cf

File tree

1 file changed

+26
-8
lines changed

1 file changed

+26
-8
lines changed

web_src/js/features/load-branches-and-tags.js

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import {showElem} from '../utils/dom.js';
22

33
async function loadBranchesAndTags(loadingButton, addHere) {
4-
loadingButton.classList.add('disabled')
4+
loadingButton.classList.add('disabled');
55
let res;
66
try {
7-
res = await fetch(loadingButton.getAttribute('data-fetch-url'), { method: 'GET', });
7+
res = await fetch(loadingButton.getAttribute('data-fetch-url'), {
8+
method: 'GET',
9+
});
810
} finally {
9-
loadingButton.classList.remove('disabled')
11+
loadingButton.classList.remove('disabled');
1012
}
1113

1214
if (!res.ok) {
@@ -16,10 +18,16 @@ async function loadBranchesAndTags(loadingButton, addHere) {
1618
const data = await res.json();
1719
showAreas('.branch-tag-area-divider');
1820
loadingButton.classList.add('gt-hidden');
19-
addHere.querySelector('.branch-tag-area-text').textContent = loadingButton.getAttribute('data-contained-in-text');
21+
addHere.querySelector('.branch-tag-area-text').textContent =
22+
loadingButton.getAttribute('data-contained-in-text');
2023
addTags(data.tags, addHere.querySelector('.tag-area'));
2124
const branchArea = addHere.querySelector('.branch-area');
22-
addBranches(data.branches, data.default_branch, branchArea.getAttribute('data-defaultbranch-tooltip'), branchArea);
25+
addBranches(
26+
data.branches,
27+
data.default_branch,
28+
branchArea.getAttribute('data-defaultbranch-tooltip'),
29+
branchArea,
30+
);
2331
}
2432

2533
function addTags(tags, addHere) {
@@ -32,7 +40,12 @@ function addTags(tags, addHere) {
3240
function addBranches(branches, defaultBranch, defaultBranchTooltip, addHere) {
3341
if (branches.length > 0) showAreas('.branch-area,.branch-area-parent');
3442
for (const branch of branches) {
35-
addLink(branch.web_link, branch.name, addHere, defaultBranch === branch.name ? defaultBranchTooltip : undefined);
43+
addLink(
44+
branch.web_link,
45+
branch.name,
46+
addHere,
47+
defaultBranch === branch.name ? defaultBranchTooltip : undefined,
48+
);
3649
}
3750
}
3851

@@ -53,9 +66,14 @@ function addLink(href, text, addHere, tooltip) {
5366
}
5467

5568
export function initLoadBranchesAndTagsButton() {
56-
for (const loadButton of document.querySelectorAll('.load-tags-and-branches')) {
69+
for (const loadButton of document.querySelectorAll(
70+
'.load-tags-and-branches',
71+
)) {
5772
loadButton.addEventListener('click', () => {
58-
loadBranchesAndTags(loadButton, document.querySelector('.branch-and-tag-area'));
73+
loadBranchesAndTags(
74+
loadButton,
75+
document.querySelector('.branch-and-tag-area'),
76+
);
5977
});
6078
}
6179
}

0 commit comments

Comments
 (0)