Closed halcyonandon closed 10 years ago
I think the problem is that we're using on
/off
methods for event binding instead of listenTo
, stopListening
.
MarkerView#close
calls model.off()
on it's Location
model. This unbinds all events from the model, not just the events which were relevant to the MarkerView
Would you be up for putting together a pull request that fixes this?
@eschwartz yes, sure, that's something I actually began doing already. Question, maybe you know the answer, if not it will become clear when I fully implement. When using stopListening, it will unbind all events, but the behavior of listenTo should unbind without needing to call stopListening on destruction of the view. Is stopListening necessary in this case?
but the behavior of listenTo should unbind without needing to call stopListening on destruction of the view
Events bound with listenTo
will only be unbound when you call stopListening
-- I guess I'm not sure exactly what you mean.
I'm going to close this for inactivity. Let me know if you're still having problems.
on refresh, it executes: this.closeChildren(); this.render();
This unbinds the events, but the issue I hit is with collection filtering.
When models are filtered in and out, everything works fine, except
This never emits the event because its unbound and the constructor never executes again when models are added or removed.
I've been trying to find a good solution to this issue, however no such luck yet.