Browse Source

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

master
Leonard Kim 8 years ago
parent
commit
21d419e517
1 changed files with 8 additions and 2 deletions
  1. 8
    2
      modules/UI/videolayout/VideoLayout.js

+ 8
- 2
modules/UI/videolayout/VideoLayout.js View File

@@ -110,6 +110,8 @@ var VideoLayout = {
110 110
         // the local video thumb maybe one pixel
111 111
         this.resizeThumbnails(false, true);
112 112
 
113
+        this._onContactClicked = onContactClicked.bind(this);
114
+
113 115
         this.registerListeners();
114 116
     },
115 117
 
@@ -133,7 +135,8 @@ var VideoLayout = {
133 135
     registerListeners() {
134 136
         eventEmitter.addListener(UIEvents.LOCAL_FLIPX_CHANGED,
135 137
             onLocalFlipXChanged);
136
-        eventEmitter.addListener(UIEvents.CONTACT_CLICKED, onContactClicked);
138
+        eventEmitter.addListener(UIEvents.CONTACT_CLICKED,
139
+            this._onContactClicked);
137 140
     },
138 141
 
139 142
     /**
@@ -142,7 +145,10 @@ var VideoLayout = {
142 145
      * @returns {void}
143 146
      */
144 147
     unregisterListeners() {
145
-        eventEmitter.removeListener(UIEvents.CONTACT_CLICKED, onContactClicked);
148
+        if (this._onContactClicked) {
149
+            eventEmitter.removeListener(UIEvents.CONTACT_CLICKED,
150
+                this._onContactClicked);
151
+        }
146 152
     },
147 153
 
148 154
     initLargeVideo () {

Loading…
Cancel
Save