add .bind

This commit is contained in:
Matias Alejo Garcia 2014-07-08 15:31:03 -03:00
parent bbac45ee7a
commit c0338a1f43
1 changed files with 3 additions and 3 deletions

View File

@ -288,9 +288,9 @@ Network.prototype._handlePeerConnection = function(dataConn) {
Network.prototype._setupPeerHandlers = function(openCallback) { Network.prototype._setupPeerHandlers = function(openCallback) {
var p = this.peer; var p = this.peer;
p.on('open', this._handlePeerOpen.bind(openCallback)); p.on('open', this._handlePeerOpen.bind(this, openCallback));
p.on('error', this._handlePeerError); p.on('error', this._handlePeerError.bind(this));
p.on('connection', this._handlePeerConnection); p.on('connection', this._handlePeerConnection.bind(this));
}; };
Network.prototype._addCopayerMap = function(peerId, copayerId) { Network.prototype._addCopayerMap = function(peerId, copayerId) {