Sha256: 0290dd440e5a1bea059b223e5ecc707b2d13d851eca0077b40039ff78640edea

Contents?: true

Size: 907 Bytes

Versions: 3

Compression:

Stored size: 907 Bytes

Contents

import { app, BrowserWindow } from 'electron'
import { enableLiveReload } from 'electron-compile'
import path from 'path'
import url from 'url'

if (process.env.NODE_ENV !== 'production')
  enableLiveReload()

let win = null

function createWindow() {
  win = new BrowserWindow({title: 'Another Neutron app', width: 800, height: 600})
  win.loadURL(url.format({
    pathname: path.join(__dirname, 'assets/index.html'),
    protocol: 'file:',
    slashes: true
  }))
  if (process.env.NODE_ENV !== 'production')
    win.webContents.openDevTools()
  win.on('close', (event) => {
    if (app.quitting)
      win = null
    else {
      event.preventDefault()
      win.hide()
    }
  })
}

app.on('ready', createWindow)

app.on('window-all-closed', () => {
  if (process.platform !== 'darwin') {
    app.quit()
  }
})

app.on('activate', () => { win.show() })

app.on('before-quit', () => app.quitting = true)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
neutron-ruby-electron-0.1.2 lib/neutron/template/src/main_window.js.tt
neutron-ruby-electron-0.1.1 lib/neutron/template/src/main_window.js.tt
neutron-ruby-electron-0.1.0 lib/neutron/template/src/main_window.js.tt