18F/mirage — pull request #345 by shawnbot (2014-11-20 00:13:25+00:00)
Title: possible fix for #324

This fix involves populating the pool title via a new asynchronous function, `InputHandler.getSelectedNAICS(callback)`. InputManager now stashes the promise returned by `$.getJSON()` in `InputHandler.populateDropdown()`, and adds a `.done()` handler to the promise in `getSelectedNAICS()`. This *should* result in the callback being called either immediately if the dropdown has already been populated, or eventually if not—after the JSON loads and the completion handler is called.

This works locally for me after repeated refreshes, but because I'm not as familiar with the code I can't say for sure whether this resolves the issue or introduces any new ones. Please take a look, test thoroughly, and let me know if anything needs to change.