Skip to content

Commit

Permalink
Fix OSX all tabs closed
Browse files Browse the repository at this point in the history
  • Loading branch information
valtlfelipe committed May 5, 2016
1 parent b38a6bd commit d407145
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions main.build.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,17 @@ app.on("open-url", function (e, url) {
}
});

/**
* Emitted when the application is activated, which usually happens when clicks on the applications's dock icon
* https://github.com/electron/electron/blob/master/docs/api/app.md#event-activate-os-x
*
* Opens a new tab when all tabs are closed, and min is still open by clicking on the application dock icon
*/
app.on("activate", function functionName(/*e, hasVisibleWindows*/) {
if (!mainWindow) {
createWindow();
}
});

function createAppMenu() {
// create the menu. based on example from http://electron.atom.io/docs/v0.34.0/api/menu/
Expand Down
11 changes: 11 additions & 0 deletions main/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,17 @@ app.on("open-url", function (e, url) {
}
});

/**
* Emitted when the application is activated, which usually happens when clicks on the applications's dock icon
* https://github.com/electron/electron/blob/master/docs/api/app.md#event-activate-os-x
*
* Opens a new tab when all tabs are closed, and min is still open by clicking on the application dock icon
*/
app.on("activate", function functionName(/*e, hasVisibleWindows*/) {
if (!mainWindow) {
createWindow();
}
});

function createAppMenu() {
// create the menu. based on example from http://electron.atom.io/docs/v0.34.0/api/menu/
Expand Down

0 comments on commit d407145

Please sign in to comment.