visible option defaults to true

This commit is contained in:
Thomas Brouard 2016-11-02 16:37:05 +01:00
parent 6cd6bec073
commit 9a8c60c3cf
2 changed files with 2 additions and 2 deletions

View file

@ -66,7 +66,7 @@ Add a new tab to the tab group and returns a `Tab` instance.
* `iconURL`: optional URL to the tab icon. * `iconURL`: optional URL to the tab icon.
* `closable` (default: `true`): if set to `true` the close button won't be displayed and the user won't be able to close the tab. See also `tab.close()`. * `closable` (default: `true`): if set to `true` the close button won't be displayed and the user won't be able to close the tab. See also `tab.close()`.
* `webviewAttributes`: attributes to add to the webview tag. See [webview documentation](http://electron.atom.io/docs/api/web-view-tag/#tag-attributes). * `webviewAttributes`: attributes to add to the webview tag. See [webview documentation](http://electron.atom.io/docs/api/web-view-tag/#tag-attributes).
* `visible` (default: `false`): set this to `true` if you want to display the tab once it is loaded. Otherwise you will need to call `tab.show()`. * `visible` (default: `true`): set this to `false` if you don't want to display the tab once it is loaded. If set to `false` then you will need to call `tab.show()` to display the tab.
* `ready`: a callback function to call once the tab is ready. The `Tab` instance is passed as the only parameter. * `ready`: a callback function to call once the tab is ready. The `Tab` instance is passed as the only parameter.
#### `tabGroup.getTab(id)` #### `tabGroup.getTab(id)`

View file

@ -130,7 +130,7 @@ class Tab extends EventEmitter {
this.tabElements = {}; this.tabElements = {};
TabPrivate.initTab.bind(this)(); TabPrivate.initTab.bind(this)();
TabPrivate.initWebview.bind(this)(); TabPrivate.initWebview.bind(this)();
if (args.visible) { if (args.visible !== false) {
this.show(); this.show();
} }
if (typeof args.ready === "function") { if (typeof args.ready === "function") {