-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
What if we remade bindEvents to have 1) a nicer API, and 2) auto-call stopListening?
Here's my thought: we could copy the backbone events object syntax:
, events: {
'click .mything': 'onMyThingClick'
}
, bbEvents: {
'change:key model': 'onModelChangeKey'
}- keys would be split on a space, just as the
eventshash does - the first part of the key would be the event to listen to
- the second part of the key would be the object to listen to.
this.would be assumed. If omitted, it will listen on the view itself - the value would be the name of the function to call
bindEventswould then become the method that parses this object. If over-ridden, (as we do now) things would behave as normal. Else, it just parses thebbEventsobject. That makes this backward-compatible.
Metadata
Metadata
Assignees
Labels
No labels