ModeratorElection/frontend/generated/jar-resources/buttonFunctions.js
2024-06-06 17:45:46 +02:00

14 lines
379 B
JavaScript

function disableOnClickListener({currentTarget: button}) {
if (button.hasAttribute('disableOnClick')) {
button.disabled = true;
}
}
window.Vaadin.Flow.button = {
initDisableOnClick: (button) => {
if (!button.__hasDisableOnClickListener) {
button.addEventListener('click', disableOnClickListener);
button.__hasDisableOnClickListener = true;
}
}
}