From fd69f6bbe57c7d07beb8778c291b5a97f3aacaab Mon Sep 17 00:00:00 2001 From: Thomas Brouard Date: Mon, 31 Oct 2016 18:03:28 +0100 Subject: [PATCH] Make the close button text customisable --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 36e5f1e..1e951b0 100644 --- a/index.js +++ b/index.js @@ -31,7 +31,8 @@ class TabGroup { tabContainerSelector: args.tabContainerSelector || ".tabs-tabcontainer", viewContainerSelector: args.viewContainerSelector || ".tabs-viewcontainer", tabClass: args.tabClass || "tabs-tab", - viewClass: args.viewClass || "tabs-view" + viewClass: args.viewClass || "tabs-view", + closeButtonText: args.closeButtonText || "❌" }; this.tabContainer = document.querySelector(options.tabContainerSelector); this.viewContainer = document.querySelector(options.viewContainerSelector); @@ -152,7 +153,7 @@ class Tab { if (this.closable) { let button = container.appendChild(document.createElement("button")); button.classList.add(`${tabClass}-button-close`); - button.innerHTML = "❌"; + button.innerHTML = this.tabGroup.options.closeButtonText; button.addEventListener("click", this.close.bind(this), false); } }