CenterForOpenScience/osf.io — pull request #1285 by brianjgeiger (2014-11-21 20:34:46+00:00)
Title: Feature/add link to large project

Disable submit button on submit. Fixes https://github.com/CenterForOpenScience/openscienceframework.org/issues/1160 in the less ideal way.

Purpose
-----------
When adding a link to a project, the submit button appears to still be active while the AJAX request happens. If a project takes a long time to serialize, then the user won't realize that the submission happened. They may click a lot on the button or just get annoyed.

![screen shot 2014-11-17 at 5 33 41 pm](https://cloud.githubusercontent.com/assets/6599111/5079243/88122494-6e80-11e4-9523-012a3efc915c.png)

Changes
------------
When you click on the submit button, it disables the button, resulting in a button that is desaturated and does not change the pointer to a hand. If the ajax request fails, it will re-enable the button. If the ajax request succeeds, then the window will go away, and you won't need the submit button again anyways.

![screen shot 2014-11-17 at 5 42 48 pm](https://cloud.githubusercontent.com/assets/6599111/5079334/3996b9f0-6e81-11e4-9928-507700981a2e.png)

Side effects
----------------
I don't know of any problems that will happen with this. With this class of changes, the likely problems will be related to the submit button being disabled when it shouldn't be.

(Replaces https://github.com/CenterForOpenScience/osf/pull/1245)