浏览代码

Checks whether we need to modify document, before change - on display name change.

master
damencho 9 年前
父节点
当前提交
613569ff09
共有 2 个文件被更改,包括 6 次插入2 次删除
  1. 3
    1
      modules/UI/side_pannels/contactlist/ContactList.js
  2. 3
    1
      modules/UI/videolayout/RemoteVideo.js

+ 3
- 1
modules/UI/side_pannels/contactlist/ContactList.js 查看文件

@@ -153,12 +153,14 @@ var ContactList = {
153 153
     },
154 154
 
155 155
     onDisplayNameChange (id, displayName) {
156
+        if(!displayName)
157
+            return;
156 158
         if (id === 'localVideoContainer') {
157 159
             id = APP.conference.localId;
158 160
         }
159 161
         let contactName = $(`#contacts #${id}>p`);
160 162
 
161
-        if (displayName) {
163
+        if (contactName.text() !== displayName) {
162 164
             contactName.text(displayName);
163 165
         }
164 166
     },

+ 3
- 1
modules/UI/videolayout/RemoteVideo.js 查看文件

@@ -357,7 +357,9 @@ RemoteVideo.prototype.setDisplayName = function(displayName, key) {
357 357
     // If we already have a display name for this video.
358 358
     if (nameSpan.length > 0) {
359 359
         if (displayName && displayName.length > 0) {
360
-            $('#' + this.videoSpanId + '_name').text(displayName);
360
+            var displaynameSpan = $('#' + this.videoSpanId + '_name');
361
+            if (displaynameSpan.text() !== displayName)
362
+                displaynameSpan.text(displayName);
361 363
         }
362 364
         else if (key && key.length > 0) {
363 365
             var nameHtml = APP.translation.generateTranslationHTML(key);

正在加载...
取消
保存