tbranyen/backbone.layoutmanager — pull request #211 by jugglinmike (2012-11-23 23:52:50+00:00)
Title: Fix bug in removing duplicate sub-views

Conditions that triggered this bug:

- A view has a sub-view which renders asynchronously due to an
asynchronous `fetch` method
- The view's `render` method is invoked multiple times before the
sub-view's `fetch` method resolves

Result:

The sub-view created in the first call to `render` is not removed by the
second call, yeilding repeated sub-views.

Fix:

Set the view's `hasRendered` flag *before* resolving the `render` method's
deferred.