浏览代码

Fixed interface

master
Ilya Daynatovich 9 年前
父节点
当前提交
138ed6a487
共有 1 个文件被更改,包括 17 次插入15 次删除
  1. 17
    15
      modules/UI/videolayout/RemoteVideo.js

+ 17
- 15
modules/UI/videolayout/RemoteVideo.js 查看文件

131
             id: 'mutelink_' + this.id,
131
             id: 'mutelink_' + this.id,
132
             handler: muteHandler,
132
             handler: muteHandler,
133
             icon: 'icon-mic-disabled',
133
             icon: 'icon-mic-disabled',
134
-            text: {
135
-                className: muteClassName,
136
-                data: {
137
-                    i18n: muteTranslationKey
138
-                }
134
+            className: muteClassName,
135
+            data: {
136
+                i18n: muteTranslationKey
139
             }
137
             }
140
         }, {
138
         }, {
141
             id: 'ejectlink_' + this.id,
139
             id: 'ejectlink_' + this.id,
142
             handler: kickHandler,
140
             handler: kickHandler,
143
             icon: 'icon-kick',
141
             icon: 'icon-kick',
144
-            text: {
145
-                data: {
146
-                    i18n: 'videothumbnail.kick'
147
-                }
142
+            data: {
143
+                i18n: 'videothumbnail.kick'
148
             }
144
             }
149
         }
145
         }
150
     ];
146
     ];
185
         id,
181
         id,
186
         handler,
182
         handler,
187
         icon,
183
         icon,
188
-        text
184
+        data,
185
+        className
189
     } = opts;
186
     } = opts;
190
 
187
 
191
     handler = handler || $.noop;
188
     handler = handler || $.noop;
196
     let linkItem = document.createElement('a');
193
     let linkItem = document.createElement('a');
197
     linkItem.className = 'popupmenu__link';
194
     linkItem.className = 'popupmenu__link';
198
 
195
 
196
+    if (className) {
197
+        linkItem.className += ` ${className}`;
198
+    }
199
+
199
     if (icon) {
200
     if (icon) {
200
         let indicator = document.createElement('span');
201
         let indicator = document.createElement('span');
201
         indicator.className = 'popupmenu__icon';
202
         indicator.className = 'popupmenu__icon';
206
     let textContent = document.createElement('span');
207
     let textContent = document.createElement('span');
207
     textContent.className = 'popupmenu__text';
208
     textContent.className = 'popupmenu__text';
208
 
209
 
209
-    let dataKeys = Object.keys(text.data);
210
-    dataKeys.forEach(key => {
211
-        textContent.dataset[key] = text.data[key];
212
-    });
213
-    textContent.className +=  ` ${text.className}` || '';
210
+    if (data) {
211
+        let dataKeys = Object.keys(data);
212
+        dataKeys.forEach(key => {
213
+            textContent.dataset[key] = data[key];
214
+        });
215
+    }
214
 
216
 
215
     linkItem.appendChild(textContent);
217
     linkItem.appendChild(textContent);
216
     linkItem.id = id;
218
     linkItem.id = id;

正在加载...
取消
保存