fix(pinning): bind the callback for contact list clicking

This commit is contained in:
Leonard Kim 2017-09-20 10:01:29 -07:00 committed by Дамян Минков
parent 6a1eff917c
commit 21d419e517
1 changed files with 8 additions and 2 deletions

View File

@ -110,6 +110,8 @@ var VideoLayout = {
// the local video thumb maybe one pixel
this.resizeThumbnails(false, true);
this._onContactClicked = onContactClicked.bind(this);
this.registerListeners();
},
@ -133,7 +135,8 @@ var VideoLayout = {
registerListeners() {
eventEmitter.addListener(UIEvents.LOCAL_FLIPX_CHANGED,
onLocalFlipXChanged);
eventEmitter.addListener(UIEvents.CONTACT_CLICKED, onContactClicked);
eventEmitter.addListener(UIEvents.CONTACT_CLICKED,
this._onContactClicked);
},
/**
@ -142,7 +145,10 @@ var VideoLayout = {
* @returns {void}
*/
unregisterListeners() {
eventEmitter.removeListener(UIEvents.CONTACT_CLICKED, onContactClicked);
if (this._onContactClicked) {
eventEmitter.removeListener(UIEvents.CONTACT_CLICKED,
this._onContactClicked);
}
},
initLargeVideo () {