From 0fd18221b1d7796a911c434f89a463c0d5f35ba3 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Tue, 8 Mar 2022 16:42:03 -0800 Subject: [PATCH] Give button_with_spinner's onclick event to the original function. --- frontends/etiquette_flask/static/js/spinner.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontends/etiquette_flask/static/js/spinner.js b/frontends/etiquette_flask/static/js/spinner.js index bf7f075..ff3bad0 100644 --- a/frontends/etiquette_flask/static/js/spinner.js +++ b/frontends/etiquette_flask/static/js/spinner.js @@ -165,7 +165,7 @@ function init_button_with_spinner() const wrapped_onclick = button.onclick; button.removeAttribute('onclick'); - button.onclick = function() + button.onclick = function(event) { if (button.dataset.spinnerGroup) { @@ -175,7 +175,7 @@ function init_button_with_spinner() { window[button.dataset.spinnerOpener](); } - const ret = wrapped_onclick(); + const ret = wrapped_onclick(event); if (ret === spinner.BAIL) { window[button.dataset.spinnerCloser]();