azavea/OTM2 — pull request #266 by jwalgran (2013-08-30 19:57:45+00:00)
Title: Prevent map clicks from requesting an undefined id

I removed the broken truthyOrError helper from baconUtils and replaced it with fetchFromIdStream, a helper that makes ajax fetches when an ID is defined and returns a default value otherwise. This prevents spurious AJAX requests with invalid URLS.

Closes #260

Additional cleanup:

- Create more accurace scope by moving variables inside the `init` function that are not used by any other function in the module
- Normalize the `treeDetails` DOM id to the more conventional `tree-details`
- Remove the last hard-coded DOM id from the module and pass it in through the options hash when calling init.
- Do not declare `clickedLatLon` as a variable. It is not reused.