marionettejs/backbone.marionette — pull request #719 by dentafrice (2013-09-06 18:08:38+00:00)
Title: Bugfix initial events

This pull request fixes #714

CollectionView does not start listening to collection events again after being closed and re-rendered.

Bug:
----

Reproduce:
1) http://jsfiddle.net/tUwVy/2/
2) Click add a few times
3) Click close
4) Click open
5) Click add a few more times.

CollectionView does not start listening to collection events again after being closed (`stopListening`) and re-rendered.

Calling internal method CollectionView#_initialEvents will rebind them again.

Proposed Solution:
----

1 Set _initialEventsBound to true immediately after calling _initialEvents in the constructor
2. Set _initialEventsBound to false when closing
3. If _initialEventsBound is false when rendering, invoke _initialEvents again.