Give button_with_spinner's onclick event to the original function.

This commit is contained in:
voussoir 2022-03-08 16:42:03 -08:00
parent 85055cdea2
commit 0fd18221b1
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -165,7 +165,7 @@ function init_button_with_spinner()
const wrapped_onclick = button.onclick; const wrapped_onclick = button.onclick;
button.removeAttribute('onclick'); button.removeAttribute('onclick');
button.onclick = function() button.onclick = function(event)
{ {
if (button.dataset.spinnerGroup) if (button.dataset.spinnerGroup)
{ {
@ -175,7 +175,7 @@ function init_button_with_spinner()
{ {
window[button.dataset.spinnerOpener](); window[button.dataset.spinnerOpener]();
} }
const ret = wrapped_onclick(); const ret = wrapped_onclick(event);
if (ret === spinner.BAIL) if (ret === spinner.BAIL)
{ {
window[button.dataset.spinnerCloser](); window[button.dataset.spinnerCloser]();