illinois-cs241 / broadway-on-demand

Webapp that facilitates on-demand assignment autograding via Broadway.
Other
11 stars 4 forks source link

Prevent clicking action buttons when making request #121

Closed Xiangmingchen closed 3 years ago

Xiangmingchen commented 3 years ago

This was first brought to my attention by a 225 CA. She added an extension but it showed up twice. I think this is caused by she accidentally double tapped the save button. When fixing the add extension button, I realized we don't have double-clicking prevention for many other action buttons too.

Description

This PR disables the actions buttons after click, and re-enable them after server respond.

Buttons modified

Testing

image

I also added a decorator function that slows down the server response by 3 second. It's useful when testing stuff like this.

JS versioning

I added a version number for modify_assignment.js because otherwise the cached js code doesn't work with the html code (due to parameter change). Both must change at once. (if not, the whole save button was spinning...) Adding a version number forces the browser to reload the new js.