Forum Discussion
_anomDiebolt_
7 years agoQrew Elite
You need to (1) "debounce" or (2) "oneshot" the button so the script (1) can not run more frequently that a specified time interval or (2) can only run once. In the demo below I choose the oneshot method.
Regarding feedback to the user, a better solution than changing the mouse cursor is to display a spinner to indicate the script is still running.
You should implement the IOL technique and use the code in the demo below. To see the demo expose the console by pressing F12 and note that repeated clicks of the first button repeatedly log while the second button can only log once.
Debounce Buttons
https://haversineconsulting.quickbase.com/db/bnr9aa7c6?a=q&qid=1
Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=661
Regarding feedback to the user, a better solution than changing the mouse cursor is to display a spinner to indicate the script is still running.
You should implement the IOL technique and use the code in the demo below. To see the demo expose the console by pressing F12 and note that repeated clicks of the first button repeatedly log while the second button can only log once.
Debounce Buttons
https://haversineconsulting.quickbase.com/db/bnr9aa7c6?a=q&qid=1
Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=661