Skip to content

Commit 6476dac

Browse files
committed
improve button loading state
1 parent a58278f commit 6476dac

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

templates/repo/issue/view_content/sidebar.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@
556556
<div class="ui divider"></div>
557557

558558
{{if or .PinEnabled .Issue.IsPinned}}
559-
<form class="gt-mt-2 form-fetch-action" method="post" {{if $.NewPinAllowed}}action="{{.Issue.Link}}/pin"{{else}}data-tooltip-content="{{.locale.Tr "repo.issues.max_pinned"}}"{{end}}>
559+
<form class="gt-mt-2 form-fetch-action single-button-form" method="post" {{if $.NewPinAllowed}}action="{{.Issue.Link}}/pin"{{else}}data-tooltip-content="{{.locale.Tr "repo.issues.max_pinned"}}"{{end}}>
560560
{{$.CsrfTokenHtml}}
561561
<button class="fluid ui button {{if not $.NewPinAllowed}}disabled{{end}}">
562562
{{if not .Issue.IsPinned}}
@@ -599,7 +599,7 @@
599599
{{end}}
600600
</div>
601601

602-
<form class="ui form form-fetch-action" action="{{.Issue.Link}}{{if .Issue.IsLocked}}/unlock{{else}}/lock{{end}}"
602+
<form class="ui form form-fetch-action single-button-form" action="{{.Issue.Link}}{{if .Issue.IsLocked}}/unlock{{else}}/lock{{end}}"
603603
method="post">
604604
{{.CsrfTokenHtml}}
605605

web_src/css/modules/animations.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,19 @@
3535
border-width: 2px;
3636
}
3737

38+
form.is-loading::after {
39+
max-height: 50%;
40+
max-width: 50%;
41+
}
42+
43+
form.single-button-form.is-loading > * {
44+
opacity: 1;
45+
}
46+
47+
form.single-button-form.is-loading .button {
48+
color: transparent;
49+
}
50+
3851
.markup pre.is-loading,
3952
.editor-loading.is-loading,
4053
.pdf-content.is-loading {

0 commit comments

Comments
 (0)