Skip to content

Commit 2203be6

Browse files
zeripathsilverwind
andauthored
Silverwind patches (go-gitea#5)
* fixes * async * more tweaks Co-authored-by: silverwind <me@silverwind.io>
2 parents a5eab5f + cb192c2 commit 2203be6

File tree

5 files changed

+41
-20
lines changed

5 files changed

+41
-20
lines changed

templates/repo/graph.tmpl

+1-3
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,15 @@
77
{{.i18n.Tr "repo.commit_graph"}}
88
<div class="ui icon buttons tiny color-buttons">
99
<div class="ui multiple selection search dropdown" id="flow-select-refs-dropdown">
10-
<input type="hidden">
10+
<input type="hidden" name="flow">
1111
<i class="dropdown icon"></i>
12-
<input type="text" class="search">
1312
<div class="default text">{{.i18n.Tr "repo.commit_graph.select"}}</div>
1413
<div class="menu">
1514
<div class="item" data-value="...flow-hide-pr-refs">
1615
<span class="truncate">
1716
{{svg "octicon-eye-closed" 16 "mr-2"}}<span title="{{.i18n.Tr "repo.commit_graph.hide_pr_refs"}}">{{.i18n.Tr "repo.commit_graph.hide_pr_refs"}}</span>
1817
</span>
1918
</div>
20-
<div class="divider"></div>
2119
{{range .AllRefs}}
2220
{{$refGroup := .RefGroup}}
2321
{{if eq $refGroup "pull"}}

web_src/js/features/gitgraph.js

+8-9
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export default async function initGitGraph() {
4848
});
4949
const url = new URL(window.location);
5050
const params = url.searchParams;
51-
const updateGraph = () => {
51+
const updateGraph = async () => {
5252
const queryString = params.toString();
5353
const ajaxUrl = new URL(url);
5454
ajaxUrl.searchParams.set('div-only', 'true');
@@ -62,14 +62,13 @@ export default async function initGitGraph() {
6262
$('#rev-container').addClass('hide');
6363
$('#loading-indicator').removeClass('hide');
6464

65-
$.ajax(ajaxUrl.toString()).then((div) => {
66-
$('#pagination').html($($.parseHTML(div)).find('#pagination').html());
67-
$('#rel-container').html($($.parseHTML(div)).find('#rel-container').html());
68-
$('#rev-container').html($($.parseHTML(div)).find('#rev-container').html());
69-
$('#loading-indicator').addClass('hide');
70-
$('#rel-container').removeClass('hide');
71-
$('#rev-container').removeClass('hide');
72-
});
65+
const div = $(await $.ajax(String(ajaxUrl)));
66+
$('#pagination').html(div.find('#pagination').html());
67+
$('#rel-container').html(div.find('#rel-container').html());
68+
$('#rev-container').html(div.find('#rev-container').html());
69+
$('#loading-indicator').addClass('hide');
70+
$('#rel-container').removeClass('hide');
71+
$('#rev-container').removeClass('hide');
7372
};
7473
const dropdownSelected = params.getAll('branch');
7574
if (params.has('hide-pr-refs') && params.get('hide-pr-refs') === 'true') {

web_src/less/_base.less

+4
Original file line numberDiff line numberDiff line change
@@ -1230,6 +1230,10 @@ table th[data-sortt-desc] {
12301230
}
12311231
}
12321232

1233+
.dropdown .ui.label {
1234+
margin-left: 0 !important;
1235+
}
1236+
12331237
.text-label {
12341238
display: inline-flex !important;
12351239
align-items: center !important;

web_src/less/features/gitgraph.less

+18-8
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,15 @@
2424
}
2525

2626
#flow-select-refs-dropdown {
27-
vertical-align: top;
28-
height: 36.8438px;
29-
max-height: 36.8438px;
30-
min-width: 250px;
3127
border-top-right-radius: 0;
3228
border-bottom-right-radius: 0;
33-
34-
div.default.text {
35-
padding-top: 6.715px;
36-
}
29+
min-width: 250px;
30+
border-right: none;
3731

3832
.ui.label {
3933
max-width: 180px;
34+
display: inline-flex !important;
35+
align-items: center;
4036

4137
.truncate {
4238
display: inline-block;
@@ -47,6 +43,20 @@
4743
white-space: nowrap;
4844
}
4945
}
46+
47+
.dropdown.icon {
48+
display: none;
49+
}
50+
51+
.default.text {
52+
padding-top: 4px;
53+
padding-bottom: 4px;
54+
}
55+
56+
input.search {
57+
position: relative;
58+
top: 1px;
59+
}
5060
}
5161

5262
li {

web_src/less/themes/theme-arc-green.less

+10
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,10 @@ body {
397397
color: #9e9e9e;
398398
}
399399

400+
input {
401+
color: #dbdbdb;
402+
}
403+
400404
/* firefox scroll bars */
401405

402406
* {
@@ -1596,6 +1600,12 @@ a.blob-excerpt:hover {
15961600
color: #dbdbdb;
15971601
}
15981602

1603+
.ui.active.label {
1604+
background: #393d4a;
1605+
border-color: #393d4a;
1606+
color: #dbdbdb;
1607+
}
1608+
15991609
a.ui.label:hover,
16001610
a.ui.labels .label:hover {
16011611
background-color: #505667 !important;

0 commit comments

Comments
 (0)