-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Events in mixin not working with backbone >= 1.2 #67
Comments
Hi! Thanks for reporting! Can you provide a code sample/example to clarify the problem? Thanks in advance! |
Hi ! You can see the problem when you run example/SpecRunner.html I use Cocktail on a project where I extend instances of a View in initalize, depending on the subtype of that View.
When I upgrade Backbone to any version greater or equal to 1.2.0, events defined in the mixin are not applied to the elements in the view. I looked into it after I posted that issue, and found a workaround. I think Backbone changed the View constructor, at least the way it delegates events.
Is it the correct way to fix it ? |
Thanks for the details. The tests are passing against Backbone 1.3.3: cocktail/externals/backbone.js Line 1 in dac954a
Is it possible for you to supply a failing test case to confirm that there's a bug with Cocktail? Any help is appreciated. I haven't used Backbone in 3 years, so I could use some help pushing this issue through to resolution. Thanks in advance! |
Hi! Just try to run cocktail/example/SpecRunner.html
These events are defined in PaginateMixin. Adding this.delegateEvents(); in PaginateMixin's render solves it. Backbone.View constructor change I was referring to : Hope this helps! |
If you extend a View with a mixin that has an events hash, these events are not apply to the element.
The text was updated successfully, but these errors were encountered: