make electronOptions configurable, remove kioskmode from documentation

This commit is contained in:
Andreas 'count' Kotes
2016-12-10 17:02:54 +01:00
committed by Andreas Kotes
parent 78aa2b491c
commit 6a184b069b
4 changed files with 11 additions and 5 deletions

View File

@@ -10,6 +10,7 @@
var defaults = {
port: 8080,
kioskmode: false,
electronOptions: {},
ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"],
language: "en",

View File

@@ -19,7 +19,7 @@ let mainWindow;
function createWindow() {
var electronOptions = {
var electronOptionsDefaults = {
width: 800,
height: 600,
x: 0,
@@ -31,13 +31,17 @@ function createWindow() {
}
}
// DEPRECATED: "kioskmode" backwards compatibility, to be removed
// settings these options directly instead provides cleaner interface
if (config.kioskmode) {
electronOptions.kiosk = true;
electronOptionsDefaults.kiosk = true;
} else {
electronOptions.fullscreen = true;
electronOptions.autoHideMenuBar = true;
electronOptionsDefaults.fullscreen = true;
electronOptionsDefaults.autoHideMenuBar = true;
}
var electronOptions = Object.assign({}, electronOptionsDefaults, config.electronOptions);
// Create the browser window.
mainWindow = new BrowserWindow(electronOptions);