aboutsummaryrefslogtreecommitdiffstats
path: root/web_src
diff options
context:
space:
mode:
Diffstat (limited to 'web_src')
-rw-r--r--web_src/js/features/common-global.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/web_src/js/features/common-global.js b/web_src/js/features/common-global.js
index b00b4aea9c..7efefd7084 100644
--- a/web_src/js/features/common-global.js
+++ b/web_src/js/features/common-global.js
@@ -260,6 +260,7 @@ export function initGlobalLinkActions() {
e.preventDefault();
const $this = $(this);
const redirect = $this.data('redirect');
+ $this.prop('disabled', true);
$.post($this.data('url'), {
_csrf: csrfToken
}).done((data) => {
@@ -270,6 +271,8 @@ export function initGlobalLinkActions() {
} else {
window.location.reload();
}
+ }).always(() => {
+ $this.prop('disabled', false);
});
}
@@ -283,11 +286,14 @@ export function initGlobalLinkActions() {
// FIXME: this is only used once, and should be replace with `link-action` instead
$('.undo-button').on('click', function () {
const $this = $(this);
+ $this.prop('disabled', true);
$.post($this.data('url'), {
_csrf: csrfToken,
id: $this.data('id')
}).done((data) => {
window.location.href = data.redirect;
+ }).always(() => {
+ $this.prop('disabled', false);
});
});
}