all main modules have init() function

This commit is contained in:
Feross Aboukhadijeh
2016-03-09 15:15:04 -08:00
parent e7d837e813
commit 713c87729a
5 changed files with 31 additions and 24 deletions

View File

@@ -9,12 +9,6 @@ var electron = require('electron')
var app = electron.app
var isQuitting = false
app.on('before-quit', function () {
isQuitting = true
})
function createMainWindow (menu) {
var win = windows.main = new electron.BrowserWindow({
autoHideMenuBar: true, // Hide top menu bar unless Alt key is pressed (Windows, Linux)
@@ -46,7 +40,7 @@ function createMainWindow (menu) {
win.on('leave-full-screen', () => menu.onToggleFullScreen(false))
win.on('close', function (e) {
if (process.platform === 'darwin' && !isQuitting) {
if (process.platform === 'darwin' && !app.isQuitting) {
e.preventDefault()
// sendSync() ensures that video will pause before window is hidden, at which point
// the update() loop (which uses requestAnimationFrame) ceases to run