Skip to content

Commit

Permalink
Merge pull request #121 from valtlfelipe/master
Browse files Browse the repository at this point in the history
Fix OS X bug when all tabs are closed
  • Loading branch information
PalmerAL committed May 6, 2016
2 parents 0b07e53 + d407145 commit 67d146f
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 67d146f

Please sign in to comment.