diff --git a/index.js b/index.js index 3089b47..c18734e 100644 --- a/index.js +++ b/index.js @@ -38,7 +38,7 @@ class TabGroup extends EventEmitter { viewClass: args.viewClass || "etabs-view", closeButtonText: args.closeButtonText || "✖", newTab: args.newTab, - newTabButtonText: args.newTabButton || "+", + newTabButtonText: args.newTabButtonText || "+", ready: args.ready }; this.tabContainer = document.querySelector(options.tabContainerSelector); @@ -163,11 +163,12 @@ class Tab extends EventEmitter { let span = this.tabElements.icon; if (iconURL) { span.innerHTML = ``; - } else if (icon) { - span.innerHTML = ``; - } - - this.emit("icon-changed", iconURL, this); + this.emit("icon-changed", iconURL, this); + } else if (icon) { + span.innerHTML = ``; + this.emit("icon-changed", icon, this); + } + return this; }