diff --git a/index.js b/index.js index c18734e..f699315 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.newTabButtonText || "+", + newTabButtonText: args.newTabButton || "+", ready: args.ready }; this.tabContainer = document.querySelector(options.tabContainerSelector); @@ -163,20 +163,23 @@ class Tab extends EventEmitter { let span = this.tabElements.icon; if (iconURL) { span.innerHTML = ``; - this.emit("icon-changed", iconURL, this); - } else if (icon) { - span.innerHTML = ``; - this.emit("icon-changed", icon, this); - } - + } else if (icon) { + span.innerHTML = ``; + } + + this.emit("icon-changed", iconURL, this); return this; } getIcon () { 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 () { if (this.isClosed) return;