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
Add/modify assignment
Add extension
Student "grade now" button
Testing
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.
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
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.