Use arrow functions to replace old CoffeeScript => this wrappers

This commit is contained in:
Kevin Sawicki 2016-03-10 11:54:17 -08:00
parent 100ea975bd
commit a3f08c9b51
10 changed files with 176 additions and 212 deletions

View file

@ -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.