From d6588fd2e7a9d33321926378587fae7f48941bd2 Mon Sep 17 00:00:00 2001 From: Thomas Brouard Date: Tue, 1 Nov 2016 14:43:42 +0100 Subject: [PATCH] Add tabGroup.getTab() method --- index.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/index.js b/index.js index 5d6a2a8..4612624 100644 --- a/index.js +++ b/index.js @@ -63,6 +63,15 @@ class TabGroup extends EventEmitter { return tab; } + getTab (id) { + for (let i in this.tabs) { + if (this.tabs[i].id === id) { + return this.tabs[i]; + } + } + return null; + } + getActiveTab () { if (this.tabs.length === 0) return null; return this.tabs[0];