Update index.js
This commit is contained in:
parent
f01cc4cf9c
commit
0589b632f6
1 changed files with 12 additions and 9 deletions
21
index.js
21
index.js
|
@ -38,7 +38,7 @@ class TabGroup extends EventEmitter {
|
||||||
viewClass: args.viewClass || "etabs-view",
|
viewClass: args.viewClass || "etabs-view",
|
||||||
closeButtonText: args.closeButtonText || "✖",
|
closeButtonText: args.closeButtonText || "✖",
|
||||||
newTab: args.newTab,
|
newTab: args.newTab,
|
||||||
newTabButtonText: args.newTabButtonText || "+",
|
newTabButtonText: args.newTabButton || "+",
|
||||||
ready: args.ready
|
ready: args.ready
|
||||||
};
|
};
|
||||||
this.tabContainer = document.querySelector(options.tabContainerSelector);
|
this.tabContainer = document.querySelector(options.tabContainerSelector);
|
||||||
|
@ -163,20 +163,23 @@ class Tab extends EventEmitter {
|
||||||
let span = this.tabElements.icon;
|
let span = this.tabElements.icon;
|
||||||
if (iconURL) {
|
if (iconURL) {
|
||||||
span.innerHTML = `<img src="${iconURL}" />`;
|
span.innerHTML = `<img src="${iconURL}" />`;
|
||||||
this.emit("icon-changed", iconURL, this);
|
} else if (icon) {
|
||||||
} else if (icon) {
|
span.innerHTML = `<i class="${icon}"></i>`;
|
||||||
span.innerHTML = `<i class="fa ${icon}"></i>`;
|
}
|
||||||
this.emit("icon-changed", icon, this);
|
|
||||||
}
|
this.emit("icon-changed", iconURL, this);
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
getIcon () {
|
getIcon () {
|
||||||
if (this.isClosed) return;
|
if (this.isClosed) return;
|
||||||
if(this.iconURL) return this.iconURL;
|
return this.icon;
|
||||||
return this.icon;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getIconUrl () {
|
||||||
|
if (this.isClosed) return ;
|
||||||
|
return this.iconURL;
|
||||||
|
}
|
||||||
|
|
||||||
activate () {
|
activate () {
|
||||||
if (this.isClosed) return;
|
if (this.isClosed) return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue