mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
Clean up duplicate code in Electron options
This commit is contained in:
parent
a08fa721cf
commit
c8d5a5319e
@ -18,13 +18,29 @@ const BrowserWindow = electron.BrowserWindow;
|
|||||||
let mainWindow;
|
let mainWindow;
|
||||||
|
|
||||||
function createWindow() {
|
function createWindow() {
|
||||||
// Create the browser window.
|
|
||||||
if (config.kioskmode) {
|
var electronOptions = {
|
||||||
mainWindow = new BrowserWindow({width: 800, height: 600, x: 0, y: 0, kiosk:true, darkTheme: true, webPreferences: {nodeIntegration: false, zoomFactor: config.zoom}});
|
width: 800,
|
||||||
} else {
|
height: 600,
|
||||||
mainWindow = new BrowserWindow({width: 800, height: 600, x: 0, y: 0, fullscreen: true, autoHideMenuBar: true, darkTheme: true, webPreferences: {nodeIntegration: false, zoomFactor: config.zoom}});
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
darkTheme: true,
|
||||||
|
webPreferences: {
|
||||||
|
nodeIntegration: false,
|
||||||
|
zoomFactor: config.zoom
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config.kioskmode) {
|
||||||
|
electronOptions.kiosk = true;
|
||||||
|
} else {
|
||||||
|
electronOptions.fullscreen = true;
|
||||||
|
electronOptions.autoHideMenuBar = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create the browser window.
|
||||||
|
mainWindow = new BrowserWindow(electronOptions);
|
||||||
|
|
||||||
// and load the index.html of the app.
|
// and load the index.html of the app.
|
||||||
//mainWindow.loadURL('file://' + __dirname + '../../index.html');
|
//mainWindow.loadURL('file://' + __dirname + '../../index.html');
|
||||||
mainWindow.loadURL("http://localhost:" + config.port);
|
mainWindow.loadURL("http://localhost:" + config.port);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user