mirror of
https://ark.sudovanilla.org/Korbs/electron-tabs.git
synced 2024-12-23 03:53:53 +00:00
addTab and options.newTab can be a function
This commit is contained in:
parent
e98e4141c5
commit
fe859786ae
3
index.js
3
index.js
|
@ -57,6 +57,9 @@ class TabGroup extends EventEmitter {
|
||||||
}
|
}
|
||||||
|
|
||||||
addTab (args = this.options.newTab) {
|
addTab (args = this.options.newTab) {
|
||||||
|
if (typeof args === "function") {
|
||||||
|
args = args(this);
|
||||||
|
}
|
||||||
let id = this.newTabId;
|
let id = this.newTabId;
|
||||||
this.newTabId++;
|
this.newTabId++;
|
||||||
let tab = new Tab(this, id, args);
|
let tab = new Tab(this, id, args);
|
||||||
|
|
Loading…
Reference in a new issue