adobe/brackets — pull request #1513 by peterflynn (2012-08-30 00:36:13+00:00)
Title: Fix bug #1384 (Exception when selecting Quick Open result by clicking)

Fix bug #1384 (Exception when selecting Quick Open result by clicking).

Any Smart Autocomplete code that runs after $.remove() will fail because remove() strips off metadata that it expects to find on the text input element. The fix is (a) to forcibly close Smart Autocomplete every time we're closing the search bar, and (b) only fully clean up the search bar after a timeout, to let Smart Autocomplete's event handlers finish running. ('A' is needed due to the [additional case Randy spotted](https://github.com/adobe/brackets/issues/1384#issuecomment-8108746), where Smart Autocomplete _never_ tries to close if there's no Editor open for it to lose focus to).

Also: rename handleDocumentClick() since it actually handles mouseDown, and clarify its comment.