mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
📝 Fix code style issue
* Change `var` to `let`.
* Change `function() {}` to `() => {}`.
* Use shorthand function syntax on object notation.
* Remove spaces between object notation brackets.
* Small fixes.
This commit is contained in:
@@ -22,7 +22,7 @@ let myNotification = new Notification('Title', {
|
||||
body: 'Lorem Ipsum Dolor Sit Amet'
|
||||
});
|
||||
|
||||
myNotification.onclick = function () {
|
||||
myNotification.onclick = () => {
|
||||
console.log('Notification clicked');
|
||||
};
|
||||
```
|
||||
@@ -118,7 +118,7 @@ const app = electron.app;
|
||||
const Menu = electron.Menu;
|
||||
|
||||
const dockMenu = Menu.buildFromTemplate([
|
||||
{ label: 'New Window', click: () => { console.log('New Window'); } },
|
||||
{ label: 'New Window', click() { console.log('New Window'); } },
|
||||
{ label: 'New Window with Settings', submenu: [
|
||||
{ label: 'Basic' },
|
||||
{ label: 'Pro'}
|
||||
@@ -221,13 +221,13 @@ win.setThumbarButtons([
|
||||
{
|
||||
tooltip: 'button1',
|
||||
icon: path.join(__dirname, 'button1.png'),
|
||||
click: () => { console.log('button2 clicked'); }
|
||||
click() { console.log('button2 clicked'); }
|
||||
},
|
||||
{
|
||||
tooltip: 'button2',
|
||||
icon: path.join(__dirname, 'button2.png'),
|
||||
flags:['enabled', 'dismissonclick'],
|
||||
click: () => { console.log('button2 clicked.'); }
|
||||
flags: ['enabled', 'dismissonclick'],
|
||||
click() { console.log('button2 clicked.'); }
|
||||
}
|
||||
]);
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user