Use arrow functions to replace old CoffeeScript => this wrappers
This commit is contained in:
parent
100ea975bd
commit
a3f08c9b51
10 changed files with 176 additions and 212 deletions
|
@ -1,3 +1,5 @@
|
|||
'use strict';
|
||||
|
||||
const ipcMain = require('electron').ipcMain;
|
||||
const deprecate = require('electron').deprecate;
|
||||
const EventEmitter = require('events').EventEmitter;
|
||||
|
@ -33,19 +35,19 @@ BrowserWindow.prototype._init = function() {
|
|||
// window.resizeTo(...)
|
||||
// window.moveTo(...)
|
||||
this.webContents.on('move', (event, size) => {
|
||||
return this.setBounds(size);
|
||||
this.setBounds(size);
|
||||
});
|
||||
|
||||
// Hide the auto-hide menu when webContents is focused.
|
||||
this.webContents.on('activate', () => {
|
||||
if (process.platform !== 'darwin' && this.isMenuBarAutoHide() && this.isMenuBarVisible()) {
|
||||
return this.setMenuBarVisibility(false);
|
||||
this.setMenuBarVisibility(false);
|
||||
}
|
||||
});
|
||||
|
||||
// Forward the crashed event.
|
||||
this.webContents.on('crashed', () => {
|
||||
return this.emit('crashed');
|
||||
this.emit('crashed');
|
||||
});
|
||||
|
||||
// Change window title to page title.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue