Tabitem — updated to include color tag

This commit is contained in:
Tamius Han 2018-12-09 01:36:30 +01:00
parent 236852bc78
commit 5d082f406c

View File

@ -1,11 +1,15 @@
class TabItem extends BaseElement {
constructor (id, name, label, isIframe, onClick, additionalClasses) {
constructor (id, name, label, isIframe, onClick, badge, additionalClasses) {
if (badge) {
label = `<div style='display: inline-block; color:#fff; background-color:${badge.color}; padding:3px 6px 1px 6px; margin-right: 5px; font-size: 0.66em; min-width: 16px; text-align: center'>${badge.name}</div> ${label}`;
}
super(id, label, onClick, additionalClasses);
this.element.classList.add('tabitem');
if (isIframe) {
this.element.classList.add('tabitem-iframe');
}
this.name = name;
}