backbone.keys
backbone.keys copied to clipboard
Check if delegateKeys is set before calling it
Marionette CollectionView calls Backbone.View.prototype.delegateEvents.call directly, on instances that don't necessarily have delegateKeys set because they referenced Backbone before the backbone.keys library was loaded (using require).
Introduce a check:
if (typeof this.delegateKeys === 'function') { this.delegateKeys(); }
Or implement as a mixin instead of overriding Backbone.View
I've tried to trigger this issue in the marionette-compliance
branch, but for me it seems to work. Could you provide some code making it break?
I also have this issue, but only when using it with the requirejs optimizer. But also with Marionette.
Can you provide a minimal example to reproduce the error?
I wish i could, but i'm not sure how to set it up. Like i said it only happens when combining/compiling with the requirejs optimiser in my case. So just creating a standalone example doesn't really show it i guess.
You must refrence backbone.keys above martionette.