jashkenas / backbone

Give your JS App some Backbone with Models, Views, Collections, and Events
http://backbonejs.org
MIT License
28.09k stars 5.39k forks source link

Adds support for non-delegated events #4199

Closed shishirkulkarni closed 1 year ago

shishirkulkarni commented 6 years ago

This pull request adds support for specifying bindings for non-delegatable events in the events hash. This removes the burden from the developer to manually maintain event bindings for non-delegatable events like scroll which is a common usecase. The way you can specify a non-delegatable event is by prefixing the event name with a *. For example:

events: {
        "*scroll .my-list": "listScrolled"
}

This pull request addresses #4200

ogonkov commented 5 years ago

Same could be achieved via subview, no need to add "magic" where it's not required.

jgonggrijp commented 1 year ago

I agree with the above comment and will close this for the same reason as #4200.