ModeratorElection/frontend/generated/jar-resources/buttonFunctions.js

15 lines
379 B
JavaScript
Raw Normal View History

2024-06-06 15:45:46 +00:00
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;
}
}
}