mirror of
https://github.com/jashkenas/backbone.git
synced 2026-01-24 14:27:56 -05:00
Setting to context to this by default on bind() instead of trigger()
This commit is contained in:
@@ -71,7 +71,7 @@
|
||||
bind : function(ev, callback, context) {
|
||||
var calls = this._callbacks || (this._callbacks = {});
|
||||
var list = calls[ev] || (calls[ev] = []);
|
||||
list.push([callback, context]);
|
||||
list.push([callback, context||this]);
|
||||
return this;
|
||||
},
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
list.splice(i, 1); i--; l--;
|
||||
} else {
|
||||
args = both ? Array.prototype.slice.call(arguments, 1) : arguments;
|
||||
callback[0].apply(callback[1] || this, args);
|
||||
callback[0].apply(callback[1], args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user