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
         // the local video thumb maybe one pixel
110
         // the local video thumb maybe one pixel
111
         this.resizeThumbnails(false, true);
111
         this.resizeThumbnails(false, true);
112
 
112
 
113
+        this._onContactClicked = onContactClicked.bind(this);
114
+
113
         this.registerListeners();
115
         this.registerListeners();
114
     },
116
     },
115
 
117
 
133
     registerListeners() {
135
     registerListeners() {
134
         eventEmitter.addListener(UIEvents.LOCAL_FLIPX_CHANGED,
136
         eventEmitter.addListener(UIEvents.LOCAL_FLIPX_CHANGED,
135
             onLocalFlipXChanged);
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
      * @returns {void}
145
      * @returns {void}
143
      */
146
      */
144
     unregisterListeners() {
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
     initLargeVideo () {
154
     initLargeVideo () {

Loading…
Cancel
Save