prevent double click new issue/pull/comment button (#16157)

* prevent double click new issue/pull/comment button

when network is not good, these button maybe
double clicked, then more than one same issues
pulls or comments will be created. this pull
request will fix this bug.

Signed-off-by: a1012112796 <1012112796@qq.com>
This commit is contained in:
a1012112796 authored and GitHub committed 2022-05-07 14:24:02 +02:00
1 parent 0eac09e066
commit 672e5a752d
3 files changed
+15 -3

No files matched your search

+12
View File
@@ -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() {