From 138ed6a487a25362bfe707421894a47b8ed2e4fe Mon Sep 17 00:00:00 2001 From: Ilya Daynatovich Date: Thu, 27 Oct 2016 18:19:37 +0300 Subject: [PATCH] Fixed interface --- modules/UI/videolayout/RemoteVideo.js | 32 ++++++++++++++------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/modules/UI/videolayout/RemoteVideo.js b/modules/UI/videolayout/RemoteVideo.js index d8ce304f4..b0f290292 100644 --- a/modules/UI/videolayout/RemoteVideo.js +++ b/modules/UI/videolayout/RemoteVideo.js @@ -131,20 +131,16 @@ RemoteVideo.prototype._generatePopupContent = function () { id: 'mutelink_' + this.id, handler: muteHandler, icon: 'icon-mic-disabled', - text: { - className: muteClassName, - data: { - i18n: muteTranslationKey - } + className: muteClassName, + data: { + i18n: muteTranslationKey } }, { id: 'ejectlink_' + this.id, handler: kickHandler, icon: 'icon-kick', - text: { - data: { - i18n: 'videothumbnail.kick' - } + data: { + i18n: 'videothumbnail.kick' } } ]; @@ -185,7 +181,8 @@ RemoteVideo.prototype._generatePopupMenuItem = function (opts = {}) { id, handler, icon, - text + data, + className } = opts; handler = handler || $.noop; @@ -196,6 +193,10 @@ RemoteVideo.prototype._generatePopupMenuItem = function (opts = {}) { let linkItem = document.createElement('a'); linkItem.className = 'popupmenu__link'; + if (className) { + linkItem.className += ` ${className}`; + } + if (icon) { let indicator = document.createElement('span'); indicator.className = 'popupmenu__icon'; @@ -206,11 +207,12 @@ RemoteVideo.prototype._generatePopupMenuItem = function (opts = {}) { let textContent = document.createElement('span'); textContent.className = 'popupmenu__text'; - let dataKeys = Object.keys(text.data); - dataKeys.forEach(key => { - textContent.dataset[key] = text.data[key]; - }); - textContent.className += ` ${text.className}` || ''; + if (data) { + let dataKeys = Object.keys(data); + dataKeys.forEach(key => { + textContent.dataset[key] = data[key]; + }); + } linkItem.appendChild(textContent); linkItem.id = id;