Update index.js

Updated a few minor things.
This commit is contained in:
Bastian Küppers 2017-02-14 20:36:42 +01:00 committed by GitHub
parent a22ea20422
commit f01cc4cf9c

View file

@ -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.newTabButton || "+", newTabButtonText: args.newTabButtonText || "+",
ready: args.ready ready: args.ready
}; };
this.tabContainer = document.querySelector(options.tabContainerSelector); this.tabContainer = document.querySelector(options.tabContainerSelector);
@ -163,11 +163,12 @@ 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}" />`;
} else if (icon) { this.emit("icon-changed", iconURL, this);
span.innerHTML = `<i class="fa ${icon}"></i>`; } else if (icon) {
} span.innerHTML = `<i class="fa ${icon}"></i>`;
this.emit("icon-changed", icon, this);
this.emit("icon-changed", iconURL, this); }
return this; return this;
} }