mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +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;
|
||||
|
||||
function createWindow() {
|
||||
// Create the browser window.
|
||||
if (config.kioskmode) {
|
||||
mainWindow = new BrowserWindow({width: 800, height: 600, x: 0, y: 0, kiosk:true, darkTheme: true, webPreferences: {nodeIntegration: false, zoomFactor: config.zoom}});
|
||||
} else {
|
||||
mainWindow = new BrowserWindow({width: 800, height: 600, x: 0, y: 0, fullscreen: true, autoHideMenuBar: true, darkTheme: true, webPreferences: {nodeIntegration: false, zoomFactor: config.zoom}});
|
||||
|
||||
var electronOptions = {
|
||||
width: 800,
|
||||
height: 600,
|
||||
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.
|
||||
//mainWindow.loadURL('file://' + __dirname + '../../index.html');
|
||||
mainWindow.loadURL("http://localhost:" + config.port);
|
||||
|
Loading…
x
Reference in New Issue
Block a user