growthcharts / james

Joint Automatic Measurement and Evaluation System (JAMES)
https://growthcharts.org/james/
GNU Affero General Public License v3.0
3 stars 0 forks source link

Throttle 3 seconds and event attachment in JS #27

Closed stefvanbuuren closed 7 months ago

stefvanbuuren commented 7 months ago

This PR introduces a throttling of 3 seconds for radio buttons, sliders and checkboxes. When a user clicks an element, JAMES will immediatetly send a request to the OCPU server, and then pause for 3 seconds before sending a next request. This reduces the strain on the server by users that are just "randomly clicking".

This PR also moves event attachment code from index.html to start.js to separate static UI definitions from its dynamic behaviour.