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