mozilla/pdf.js — pull request #3607 by Snuffleupagus (2013-08-22 14:51:20+00:00)
Title: Prevent searching during load from breaking the find functionality

This patch fixes #3604. It does this by adding a promise that is resolved when enough of the file is loaded, to avoid issues with properties of `PDFView` not being defined when the user tries to search.

Initially I tried just moving `PDFFindController.initialize(...)` in viewer.js, but this didn't really seem to help. Furthermore, that also doesn't seem like a good solution, since that would delay the registering of the find event listeners, which might not be ideal considering that we use that built-in findbar in Firefox.

Finally, this patch also fixes a few coding style nits in pdf_find_controller.js and removes some old dead code from viewer.js.

I hope that the approach in this patch is sound!