Skip to content

Commit

Permalink
Merge pull request #693 from chronologic/develop
Browse files Browse the repository at this point in the history
1.0.1
  • Loading branch information
josipbagaric authored Sep 14, 2018
2 parents 665605d + ff41d1c commit 3c89dc0
Show file tree
Hide file tree
Showing 2 changed files with 141 additions and 74 deletions.
17 changes: 9 additions & 8 deletions electron-app/main/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Modules to control application life and create native browser window
const { app, BrowserWindow, Menu, shell, protocol, globalShortcut } = require('electron');
const { app, BrowserWindow, Menu, shell, protocol } = require('electron');

const path = require('path');
const urlLib = require('url');
Expand Down Expand Up @@ -76,6 +76,10 @@ function createWindow() {
mainWindow = null;
});

mainWindow.reload = () => {
mainWindow.loadURL(MAIN_URL);
};

const HELP_MENU = {
role: 'help',
submenu: [
Expand Down Expand Up @@ -106,6 +110,10 @@ function createWindow() {
{ label: 'Select All', accelerator: 'CmdOrCtrl+A', selector: 'selectAll:' }
]
},
{
label: 'Window',
submenu: [{ label: 'Reload', accelerator: 'CmdOrCtrl+R', click: mainWindow.reload }]
},
HELP_MENU
];

Expand Down Expand Up @@ -142,13 +150,6 @@ function createWindow() {
event.preventDefault();
}
});

mainWindow.reload = () => {
mainWindow.loadURL(MAIN_URL);
};

globalShortcut.register('F5', mainWindow.reload);
globalShortcut.register('CommandOrControl+R', mainWindow.reload);
}

// This method will be called when Electron has finished
Expand Down
Loading

0 comments on commit 3c89dc0

Please sign in to comment.