Change default selectors

This commit is contained in:
Thomas Brouard 2016-11-02 12:41:18 +01:00
parent 790cbfca76
commit c1eda03445
2 changed files with 14 additions and 14 deletions

View file

@ -15,9 +15,9 @@ $ npm install --save electron-tabs
Add the following elements in the page HTML:
```html
<div class="tabs-tabcontainer"></div>
<div class="tabs-buttonscontainer"></div>
<div class="tabs-viewcontainer"></div>
<div class="etabs-tabs"></div>
<div class="etabs-buttons"></div>
<div class="etabs-views"></div>
```
And call the module in the renderer process:
@ -47,11 +47,11 @@ Represents the main tab container.
`options` must be an object. The following options are available:
* `tabContainerSelector` (default: `".tabs-tabcontainer"`): CSS selector to target the element where tabs are inserted.
* `buttonsContainerSelector` (default: `".tabs-buttonscontainer"`): CSS selector to target the element where the "New Tab" button are inserted.
* `viewContainerSelector` (default: `".tabs-viewcontainer"`): CSS selector to target the element where the view are inserted.
* `tabClass` (default: `"tabs-tab"`): class to add to tab elements.
* `viewClass` (default: `"tabs-view"`): class to add to webview elements.
* `tabContainerSelector` (default: `".etabs-tabs"`): CSS selector to target the element where tabs are inserted.
* `buttonsContainerSelector` (default: `".etabs-buttons"`): CSS selector to target the element where the "New Tab" button are inserted.
* `viewContainerSelector` (default: `".etabs-views"`): CSS selector to target the element where the view are inserted.
* `tabClass` (default: `"etabs-tab"`): class to add to tab elements.
* `viewClass` (default: `"etabs-view"`): class to add to webview elements.
* `closeButtonText` (default: `"&#x274c;"`): "close tab" button text.
* `newTabButtonText` (default: `"+"`): "New Tab" button text.
* `newTab` (default: `undefined`): arguments to use when `.addTab()` is called without parameters. It can be an object or a function which returns an object. It determines the options to use when the "New Tab" button is triggered. If you leave it undefined then the "New Tab" button won't be displayed.
@ -141,4 +141,4 @@ The following events are available:
## License
The MIT License (MIT) - Copyright (c) 2016 Thomas Brouard
The MIT License (MIT) - Copyright (c) 2016 Thomas Brouard

View file

@ -31,11 +31,11 @@ class TabGroup extends EventEmitter {
constructor (args = {}) {
super();
let options = this.options = {
tabContainerSelector: args.tabContainerSelector || ".tabs-tabcontainer",
buttonsContainerSelector: args.buttonsContainerSelector || ".tabs-buttonscontainer",
viewContainerSelector: args.viewContainerSelector || ".tabs-viewcontainer",
tabClass: args.tabClass || "tabs-tab",
viewClass: args.viewClass || "tabs-view",
tabContainerSelector: args.tabContainerSelector || ".etabs-tabs",
buttonsContainerSelector: args.buttonsContainerSelector || ".etabs-buttons",
viewContainerSelector: args.viewContainerSelector || ".etabs-views",
tabClass: args.tabClass || "etabs-tab",
viewClass: args.viewClass || "etabs-view",
closeButtonText: args.closeButtonText || "&#x274c;",
newTab: args.newTab,
newTabButtonText: args.newTabButton || "+",