From: Cheng Zhao Date: Thu, 22 Oct 2015 06:24:09 +0000 (+0800) Subject: docs: Make code more JS-style X-Git-Tag: v0.34.1~8 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=63cc2ec3691324df91ae3814bae21327baf16ffd;p=electron.git docs: Make code more JS-style --- diff --git a/docs/api/app.md b/docs/api/app.md index 9c9afdee..95aa80b6 100644 --- a/docs/api/app.md +++ b/docs/api/app.md @@ -245,7 +245,7 @@ Returns the current application locale. Resolves the proxy information for `url`. The `callback` will be called with `callback(proxy)` when the request is performed. -### `app.addRecentDocument(path)` +### `app.addRecentDocument(path)` _OS X_ _Windows_ * `path` String @@ -254,7 +254,7 @@ Adds `path` to the recent documents list. This list is managed by the OS. On Windows you can visit the list from the task bar, and on OS X you can visit it from dock menu. -### `app.clearRecentDocuments()` +### `app.clearRecentDocuments()` _OS X_ _Windows_ Clears the recent documents list. @@ -308,10 +308,9 @@ primary window focused and non-minimized. `false` if the secondary process should retry sending it or it failed. ```js +var myWindow; app.on('ready', function() { - var myWindow; - - var shouldQuit = app.makeSingleInstance(function(command_line, working_directory) { + var shouldQuit = app.makeSingleInstance(function(commandLine, workingDirectory) { // Someone tried to run a second instance, we should focus our window if (myWindow) { if (myWindow.isMinimized()) myWindow.restore();