Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upDoesn't trigger non-change item events like a collection does. #25
Comments
bear
added
the
bug
label
Nov 26, 2014
added a commit
that referenced
this issue
Nov 26, 2014
kamilogorek
referenced this issue
Nov 26, 2014
Closed
Allow for bubbling models custom events to subcollections. Fix #25 #26
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
aaronmccall
Dec 12, 2014
The issue here appears to be that the subcollection has no way to know whether the event originated from a model that is in fact in its filtered version of the collection.
We could go the route of #26, or we could clarify exactly what events we want to exclude from bubbling. We already listen for every event via the collection, so it seems we should use that if we can instead of adding and removing handlers to/from every model.
Below is the line that currently decides what to bubble.
// conditions under which we should proxy the events
if ((_.contains(['sync', 'invalid', 'destroy']) || eventName.indexOf('change') !== -1) && this.contains(model)) {
this.trigger.apply(this, arguments);
}Can we change the eventName checks to a blacklist and trigger if no match?
aaronmccall
commented
Dec 12, 2014
|
The issue here appears to be that the subcollection has no way to know whether the event originated from a model that is in fact in its filtered version of the collection. We could go the route of #26, or we could clarify exactly what events we want to exclude from bubbling. We already listen for every event via the collection, so it seems we should use that if we can instead of adding and removing handlers to/from every model. Below is the line that currently decides what to bubble. // conditions under which we should proxy the events
if ((_.contains(['sync', 'invalid', 'destroy']) || eventName.indexOf('change') !== -1) && this.contains(model)) {
this.trigger.apply(this, arguments);
}Can we change the |
latentflip commentedNov 26, 2014
In a collection I can fire a custom event on an item in the colleciton and it will fire on the collection, this doesn't happen on a subcollection.