From 7871f41e54ca413cb9e6830fc8fe678336b75040 Mon Sep 17 00:00:00 2001 From: Elton Chen-Yu Ho Date: Wed, 14 Jun 2017 21:30:04 +0800 Subject: [PATCH 1/3] fix issue #15 add duplicate tab when addTab with {active:true} --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 62882b9..e687848 100644 --- a/index.js +++ b/index.js @@ -59,6 +59,9 @@ class TabGroup extends EventEmitter { this.newTabId++; let tab = new Tab(this, id, args); this.tabs.push(tab); + if (args.active === true) { + tab.activate(); + } this.emit("tab-added", tab, this); return tab; } @@ -134,9 +137,6 @@ class Tab extends EventEmitter { if (args.visible !== false) { this.show(); } - if (args.active === true) { - this.activate(); - } if (typeof args.ready === "function") { args.ready(this); } From 7f91ffc5bdb70b652bf5b7e74799488bb9b61f39 Mon Sep 17 00:00:00 2001 From: Elton Chen-Yu Ho Date: Wed, 14 Jun 2017 22:51:10 +0800 Subject: [PATCH 2/3] add comment describing previous changes --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index e687848..9cb3540 100644 --- a/index.js +++ b/index.js @@ -59,6 +59,7 @@ class TabGroup extends EventEmitter { this.newTabId++; let tab = new Tab(this, id, args); this.tabs.push(tab); + // Don't call tab.activate() before a tab is referenced in this.tabs if (args.active === true) { tab.activate(); } From 0eeafee7f2d3d9798df240012f51fb404acafc2b Mon Sep 17 00:00:00 2001 From: Thomas Brouard Date: Thu, 15 Jun 2017 09:40:39 +0200 Subject: [PATCH 3/3] 0.6.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9eeaa88..16f2f6c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron-tabs", - "version": "0.6.0", + "version": "0.6.1", "description": "Simple tabs for Electron applications", "main": "index.js", "repository": {