Fixed interface

This commit is contained in:
Ilya Daynatovich 2016-10-27 18:19:37 +03:00
parent d84d0b65ca
commit 138ed6a487
1 changed files with 17 additions and 15 deletions

View File

@ -131,20 +131,16 @@ RemoteVideo.prototype._generatePopupContent = function () {
id: 'mutelink_' + this.id, id: 'mutelink_' + this.id,
handler: muteHandler, handler: muteHandler,
icon: 'icon-mic-disabled', icon: 'icon-mic-disabled',
text: { className: muteClassName,
className: muteClassName, data: {
data: { i18n: muteTranslationKey
i18n: muteTranslationKey
}
} }
}, { }, {
id: 'ejectlink_' + this.id, id: 'ejectlink_' + this.id,
handler: kickHandler, handler: kickHandler,
icon: 'icon-kick', icon: 'icon-kick',
text: { data: {
data: { i18n: 'videothumbnail.kick'
i18n: 'videothumbnail.kick'
}
} }
} }
]; ];
@ -185,7 +181,8 @@ RemoteVideo.prototype._generatePopupMenuItem = function (opts = {}) {
id, id,
handler, handler,
icon, icon,
text data,
className
} = opts; } = opts;
handler = handler || $.noop; handler = handler || $.noop;
@ -196,6 +193,10 @@ RemoteVideo.prototype._generatePopupMenuItem = function (opts = {}) {
let linkItem = document.createElement('a'); let linkItem = document.createElement('a');
linkItem.className = 'popupmenu__link'; linkItem.className = 'popupmenu__link';
if (className) {
linkItem.className += ` ${className}`;
}
if (icon) { if (icon) {
let indicator = document.createElement('span'); let indicator = document.createElement('span');
indicator.className = 'popupmenu__icon'; indicator.className = 'popupmenu__icon';
@ -206,11 +207,12 @@ RemoteVideo.prototype._generatePopupMenuItem = function (opts = {}) {
let textContent = document.createElement('span'); let textContent = document.createElement('span');
textContent.className = 'popupmenu__text'; textContent.className = 'popupmenu__text';
let dataKeys = Object.keys(text.data); if (data) {
dataKeys.forEach(key => { let dataKeys = Object.keys(data);
textContent.dataset[key] = text.data[key]; dataKeys.forEach(key => {
}); textContent.dataset[key] = data[key];
textContent.className += ` ${text.className}` || ''; });
}
linkItem.appendChild(textContent); linkItem.appendChild(textContent);
linkItem.id = id; linkItem.id = id;