Merge remote-tracking branch 'brrd/master'

This commit is contained in:
Alexander Wåland 2017-06-25 15:31:52 +02:00
commit c84d8194a5
2 changed files with 5 additions and 4 deletions

View file

@ -59,6 +59,10 @@ class TabGroup extends EventEmitter {
this.newTabId++; this.newTabId++;
let tab = new Tab(this, id, args); let tab = new Tab(this, id, args);
this.tabs.push(tab); this.tabs.push(tab);
// Don't call tab.activate() before a tab is referenced in this.tabs
if (args.active === true) {
tab.activate();
}
this.emit("tab-added", tab, this); this.emit("tab-added", tab, this);
return tab; return tab;
} }
@ -135,9 +139,6 @@ class Tab extends EventEmitter {
if (args.visible !== false) { if (args.visible !== false) {
this.show(); this.show();
} }
if (args.active === true) {
this.activate();
}
if (typeof args.ready === "function") { if (typeof args.ready === "function") {
args.ready(this); args.ready(this);
} }

View file

@ -1,6 +1,6 @@
{ {
"name": "electron-tabs", "name": "electron-tabs",
"version": "0.6.0", "version": "0.6.1",
"description": "Simple tabs for Electron applications", "description": "Simple tabs for Electron applications",
"main": "index.js", "main": "index.js",
"repository": { "repository": {