chore: update to standard 12

This commit is contained in:
Samuel Attard 2018-09-14 02:10:51 +10:00
parent 9e85bdb02c
commit 558fff69e7
No known key found for this signature in database
GPG key ID: E89DDE5742D58C4E
198 changed files with 4455 additions and 2940 deletions

View file

@ -7,16 +7,16 @@ Process: [Main](../glossary.md#main-process)
`Tray` is an [EventEmitter][event-emitter].
```javascript
const {app, Menu, Tray} = require('electron')
const { app, Menu, Tray } = require('electron')
let tray = null
app.on('ready', () => {
tray = new Tray('/path/to/my/icon')
const contextMenu = Menu.buildFromTemplate([
{label: 'Item1', type: 'radio'},
{label: 'Item2', type: 'radio'},
{label: 'Item3', type: 'radio', checked: true},
{label: 'Item4', type: 'radio'}
{ label: 'Item1', type: 'radio' },
{ label: 'Item2', type: 'radio' },
{ label: 'Item3', type: 'radio', checked: true },
{ label: 'Item4', type: 'radio' }
])
tray.setToolTip('This is my application.')
tray.setContextMenu(contextMenu)
@ -35,14 +35,14 @@ __Platform limitations:__
you have to call `setContextMenu` again. For example:
```javascript
const {app, Menu, Tray} = require('electron')
const { app, Menu, Tray } = require('electron')
let appIcon = null
app.on('ready', () => {
appIcon = new Tray('/path/to/my/icon')
const contextMenu = Menu.buildFromTemplate([
{label: 'Item1', type: 'radio'},
{label: 'Item2', type: 'radio'}
{ label: 'Item1', type: 'radio' },
{ label: 'Item2', type: 'radio' }
])
// Make a change to the context menu
@ -225,9 +225,9 @@ by toggling between `'never'` and `'always'` modes when the window visibility
changes.
```javascript
const {BrowserWindow, Tray} = require('electron')
const { BrowserWindow, Tray } = require('electron')
const win = new BrowserWindow({width: 800, height: 600})
const win = new BrowserWindow({ width: 800, height: 600 })
const tray = new Tray('/path/to/my/icon')
tray.on('click', () => {