зеркало из https://github.com/electron/electron.git
finish standardizing!
This commit is contained in:
Родитель
4e2f1311e0
Коммит
42e7ee2b4a
|
@ -243,7 +243,7 @@ function loadApplicationPackage (packagePath) {
|
|||
} else if (packageJson.name) {
|
||||
app.setName(packageJson.name)
|
||||
}
|
||||
|
||||
|
||||
app.setPath('userData', path.join(app.getPath('appData'), app.getName()))
|
||||
app.setPath('userCache', path.join(app.getPath('cache'), app.getName()))
|
||||
app.setAppPath(packagePath)
|
||||
|
@ -251,7 +251,7 @@ function loadApplicationPackage (packagePath) {
|
|||
|
||||
// Run the app.
|
||||
require('module')._load(packagePath, module, true)
|
||||
} catch(e) {
|
||||
} catch (e) {
|
||||
if (e.code === 'MODULE_NOT_FOUND') {
|
||||
app.focus()
|
||||
dialog.showErrorBox(
|
||||
|
@ -319,5 +319,6 @@ if (option.file && !option.webdriver) {
|
|||
} else if (option.interactive) {
|
||||
startRepl()
|
||||
} else {
|
||||
loadApplicationByUrl('file://' + __dirname + '/index.html')
|
||||
var indexPath = path.join(__dirname, '/index.html')
|
||||
loadApplicationByUrl(`file://${indexPath}`)
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ if (process.platform === 'darwin') {
|
|||
var appPath = null
|
||||
|
||||
app.setAppPath = function (path) {
|
||||
return appPath = path
|
||||
appPath = path
|
||||
}
|
||||
|
||||
app.getAppPath = function () {
|
||||
|
|
|
@ -30,10 +30,10 @@ var spawnUpdate = function (args, detached, callback) {
|
|||
stdout = ''
|
||||
stderr = ''
|
||||
spawnedProcess.stdout.on('data', function (data) {
|
||||
return stdout += data
|
||||
stdout += data
|
||||
})
|
||||
spawnedProcess.stderr.on('data', function (data) {
|
||||
return stderr += data
|
||||
stderr += data
|
||||
})
|
||||
errorEmitted = false
|
||||
spawnedProcess.on('error', function (error) {
|
||||
|
|
|
@ -53,12 +53,11 @@ BrowserWindow.prototype._init = function () {
|
|||
this.webContents.on('page-title-updated', (event, title) => {
|
||||
// The page-title-updated event is not emitted immediately (see #3645), so
|
||||
// when the callback is called the BrowserWindow might have been closed.
|
||||
if (this.isDestroyed())
|
||||
return
|
||||
if (this.isDestroyed()) return
|
||||
|
||||
// Route the event to BrowserWindow.
|
||||
this.emit('page-title-updated', event, title)
|
||||
if (!event.defaultPrevented)
|
||||
this.setTitle(title)
|
||||
if (!event.defaultPrevented) this.setTitle(title)
|
||||
})
|
||||
|
||||
// Sometimes the webContents doesn't get focus when window is shown, so we have
|
||||
|
|
|
@ -29,7 +29,18 @@ MenuItem = (function () {
|
|||
function MenuItem (options) {
|
||||
var click, ref
|
||||
const Menu = require('electron').Menu
|
||||
click = options.click, this.selector = options.selector, this.type = options.type, this.role = options.role, this.label = options.label, this.sublabel = options.sublabel, this.accelerator = options.accelerator, this.icon = options.icon, this.enabled = options.enabled, this.visible = options.visible, this.checked = options.checked, this.submenu = options.submenu
|
||||
click = options.click
|
||||
this.selector = options.selector
|
||||
this.type = options.type
|
||||
this.role = options.role
|
||||
this.label = options.label
|
||||
this.sublabel = options.sublabel
|
||||
this.accelerator = options.accelerator
|
||||
this.icon = options.icon
|
||||
this.enabled = options.enabled
|
||||
this.visible = options.visible
|
||||
this.checked = options.checked
|
||||
this.submenu = options.submenu
|
||||
if ((this.submenu != null) && this.submenu.constructor !== Menu) {
|
||||
this.submenu = Menu.buildFromTemplate(this.submenu)
|
||||
}
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* globals $ */
|
||||
|
||||
(function () {
|
||||
const asar = process.binding('atom_common_asar')
|
||||
const child_process = require('child_process')
|
||||
|
|
Загрузка…
Ссылка в новой задаче