mirror of
https://ark.sudovanilla.org/Korbs/electron-tabs.git
synced 2024-12-23 03:53:53 +00:00
Add tabGroup.getTab() method
This commit is contained in:
parent
d17be60941
commit
d6588fd2e7
9
index.js
9
index.js
|
@ -63,6 +63,15 @@ class TabGroup extends EventEmitter {
|
||||||
return tab;
|
return tab;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getTab (id) {
|
||||||
|
for (let i in this.tabs) {
|
||||||
|
if (this.tabs[i].id === id) {
|
||||||
|
return this.tabs[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
getActiveTab () {
|
getActiveTab () {
|
||||||
if (this.tabs.length === 0) return null;
|
if (this.tabs.length === 0) return null;
|
||||||
return this.tabs[0];
|
return this.tabs[0];
|
||||||
|
|
Loading…
Reference in a new issue