Tabitem — updated to include color tag
This commit is contained in:
parent
236852bc78
commit
5d082f406c
@ -1,11 +1,15 @@
|
|||||||
class TabItem extends BaseElement {
|
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);
|
super(id, label, onClick, additionalClasses);
|
||||||
this.element.classList.add('tabitem');
|
this.element.classList.add('tabitem');
|
||||||
if (isIframe) {
|
if (isIframe) {
|
||||||
this.element.classList.add('tabitem-iframe');
|
this.element.classList.add('tabitem-iframe');
|
||||||
}
|
}
|
||||||
|
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user