Skip to content

Commit

Permalink
Merge branch 'main' into go-gitea#19637-fix-teams-dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
6543 authored May 7, 2022
2 parents 9001ed8 + 672e5a7 commit 245b9dd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion templates/repo/issue/new_form.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</div>
{{template "repo/issue/comment_tab" .}}
<div class="text right">
<button class="ui green button" tabindex="6">
<button class="ui green button loading-button" tabindex="6">
{{if .PageIsComparePull}}
{{.i18n.Tr "repo.pulls.create"}}
{{else}}
Expand Down
4 changes: 2 additions & 2 deletions templates/repo/issue/view_content.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
</div>
{{end}}
{{end}}
<button class="ui green button" tabindex="5">
<button class="ui green button loading-button" tabindex="5">
{{.i18n.Tr "repo.issues.create_comment"}}
</button>
</div>
Expand Down Expand Up @@ -172,7 +172,7 @@
</div>
{{end}}
{{end}}
<button class="ui green button" tabindex="5">
<button class="ui green button loading-button" tabindex="5">
{{.i18n.Tr "repo.issues.create_comment"}}
</button>
</div>
Expand Down
12 changes: 12 additions & 0 deletions web_src/js/features/common-global.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,18 @@ export function initGlobalCommon() {
window.location = href;
}
});

// loading-button this logic used to prevent push one form more than one time
$(document).on('click', '.button.loading-button', function (e) {
const $btn = $(this);

if ($btn.hasClass('loading')) {
e.preventDefault();
return false;
}

$btn.addClass('loading disabled');
});
}

export function initGlobalDropzone() {
Expand Down

0 comments on commit 245b9dd

Please sign in to comment.