Your collection won't send out a 'ponyUp'
event, your event aggregator (Mlp.vent
) will. When you say this:
Mlp.vent.trigger('ponyUp', @collection)
You're asking Mlp.vent
to send out a 'ponyUp'
event with @collection
as the argument, you're not triggering a 'ponyUp'
event from @collection
. That means that you'd want to listen to Mlp.vent
for the event and this:
@collection.on('ponyUp', @alterbox, this)
should look more like this:
Mlp.vent.on('ponyUp', @alterbox, this)
Alternatively, you could trigger the event on the collection by hand with something like this:
@collection.trigger('ponyUp', @collection)
The main difference between the two approaches is that using Mlp.vent
allows anyone to listen for the event even if they don't have the collection in hand whereas the @collection.trigger
approach requires everyone to have a reference to the collection before they can listen for the event.