When the JavaScript parser gets here:
'events': { 'click input[type="button"]': this.buttonClicked },
this is probably a window , not a BB instance, as you would expect. The window object does not have a buttonClicked property (at least in your case it is not), so you really say that:
'events': { 'click input[type="button"]': undefined },
and there is your mistake.
If you look at the source of delegateEvents , you will see what ChangeLog means:
delegateEvents: function(events) { // ... for (var key in events) { var method = events[key]; if (!_.isFunction(method)) method = this[events[key]]; // ... } },
That _.isFunction call is what interests you. This means that you can say these things:
events: { 'click input[type="button"]': function() { alert('pancakes!') }, 'click button': some_function_that_is_in_scope }
Thus, you can put certain functions (either by their name, if available, or as function literals) in the events lookup table.
mu is too short
source share