mirror of
https://ark.sudovanilla.org/Korbs/electron-tabs.git
synced 2024-12-23 03:53:53 +00:00
Make the close button text customisable
This commit is contained in:
parent
9f50d55dcd
commit
fd69f6bbe5
5
index.js
5
index.js
|
@ -31,7 +31,8 @@ class TabGroup {
|
||||||
tabContainerSelector: args.tabContainerSelector || ".tabs-tabcontainer",
|
tabContainerSelector: args.tabContainerSelector || ".tabs-tabcontainer",
|
||||||
viewContainerSelector: args.viewContainerSelector || ".tabs-viewcontainer",
|
viewContainerSelector: args.viewContainerSelector || ".tabs-viewcontainer",
|
||||||
tabClass: args.tabClass || "tabs-tab",
|
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.tabContainer = document.querySelector(options.tabContainerSelector);
|
||||||
this.viewContainer = document.querySelector(options.viewContainerSelector);
|
this.viewContainer = document.querySelector(options.viewContainerSelector);
|
||||||
|
@ -152,7 +153,7 @@ class Tab {
|
||||||
if (this.closable) {
|
if (this.closable) {
|
||||||
let button = container.appendChild(document.createElement("button"));
|
let button = container.appendChild(document.createElement("button"));
|
||||||
button.classList.add(`${tabClass}-button-close`);
|
button.classList.add(`${tabClass}-button-close`);
|
||||||
button.innerHTML = "❌";
|
button.innerHTML = this.tabGroup.options.closeButtonText;
|
||||||
button.addEventListener("click", this.close.bind(this), false);
|
button.addEventListener("click", this.close.bind(this), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue