diff --git a/src/dashboard/dashboardgeneral.js b/src/dashboard/dashboardgeneral.js index f220be4cc0..74a7f1cc8f 100644 --- a/src/dashboard/dashboardgeneral.js +++ b/src/dashboard/dashboardgeneral.js @@ -12,13 +12,25 @@ define(["jQuery", "loading", "fnchecked", "emby-checkbox", "emby-textarea", "emb var form = this; $(form).parents(".page"); return ApiClient.getServerConfiguration().then(function(config) { - config.UICulture = $("#selectLocalizationLanguage", form).val(), config.CachePath = form.querySelector("#txtCachePath").value; - var requiresReload = !1; - config.UICulture !== currentLanguage && (requiresReload = !0), config.EnableAutomaticRestart = $("#chkEnableAutomaticRestart", form).checked(), config.EnableAutoUpdate = $("#chkEnableAutomaticServerUpdates", form).checked(), ApiClient.updateServerConfiguration(config).then(function() { + config.UICulture = $("#selectLocalizationLanguage", form).val(); + config.CachePath = form.querySelector("#txtCachePath").value; + var requiresReload = false; + if (config.UICulture !== currentLanguage) { + requiresReload = true; + } + config.EnableAutomaticRestart = $("#chkEnableAutomaticRestart", form).checked(); + config.EnableAutoUpdate = $("#chkEnableAutomaticServerUpdates", form).checked(); + ApiClient.updateServerConfiguration(config).then(function() { ApiClient.getNamedConfiguration(brandingConfigKey).then(function(brandingConfig) { - brandingConfig.LoginDisclaimer = form.querySelector("#txtLoginDisclaimer").value, brandingConfig.CustomCss = form.querySelector("#txtCustomCss").value, currentBrandingOptions && brandingConfig.CustomCss !== currentBrandingOptions.CustomCss && (requiresReload = !0), ApiClient.updateNamedConfiguration(brandingConfigKey, brandingConfig).then(function() { - Dashboard.processServerConfigurationUpdateResult(), requiresReload && !AppInfo.isNativeApp && window.location.reload(!0) - }) + brandingConfig.LoginDisclaimer = form.querySelector("#txtLoginDisclaimer").value; + brandingConfig.CustomCss = form.querySelector("#txtCustomCss").value; + currentBrandingOptions && brandingConfig.CustomCss !== currentBrandingOptions.CustomCss && (requiresReload = !0); + ApiClient.updateNamedConfiguration(brandingConfigKey, brandingConfig).then(function() { + Dashboard.processServerConfigurationUpdateResult(); + if (requiresReload && !AppInfo.isNativeApp) { + window.location.reload(true); + } + }); }) }) }), !1 @@ -37,7 +49,26 @@ define(["jQuery", "loading", "fnchecked", "emby-checkbox", "emby-textarea", "emb instruction: Globalize.translate("HeaderSelectServerCachePathHelp") }) }) - }), $(".dashboardGeneralForm", view).off("submit", onSubmit).on("submit", onSubmit), view.addEventListener("viewshow", function() { + }); + + $("#btnSelectMetadataPath", view).on("click.selectDirectory", function() { + require(["directorybrowser"], function(directoryBrowser) { + var picker = new directoryBrowser; + picker.show({ + path: $("#txtMetadataPath", view).val(), + networkSharePath: $("#txtMetadataNetworkPath", view).val(), + callback: function(path, networkPath) { + path && ($("#txtMetadataPath", view).val(path), $("#txtMetadataNetworkPath", view).val(networkPath)), picker.close() + }, + validateWriteable: !0, + header: Globalize.translate("HeaderSelectMetadataPath"), + instruction: Globalize.translate("HeaderSelectMetadataPathHelp"), + enableNetworkSharePath: !0 + }) + }) + }); + + $(".dashboardGeneralForm", view).off("submit", onSubmit).on("submit", onSubmit), view.addEventListener("viewshow", function() { var promise1 = ApiClient.getServerConfiguration(), promise2 = ApiClient.getJSON(ApiClient.getUrl("Localization/Options")), promise3 = ApiClient.getSystemInfo(); diff --git a/src/dashboard/librarysettings.js b/src/dashboard/librarysettings.js index afbf033dfb..4a967537b7 100644 --- a/src/dashboard/librarysettings.js +++ b/src/dashboard/librarysettings.js @@ -62,22 +62,7 @@ define(["jQuery", "loading", "libraryMenu", "fnchecked", "emby-checkbox", "emby- }] } return function(view, params) { - $("#btnSelectMetadataPath", view).on("click.selectDirectory", function() { - require(["directorybrowser"], function(directoryBrowser) { - var picker = new directoryBrowser; - picker.show({ - path: $("#txtMetadataPath", view).val(), - networkSharePath: $("#txtMetadataNetworkPath", view).val(), - callback: function(path, networkPath) { - path && ($("#txtMetadataPath", view).val(path), $("#txtMetadataNetworkPath", view).val(networkPath)), picker.close() - }, - validateWriteable: !0, - header: Globalize.translate("HeaderSelectMetadataPath"), - instruction: Globalize.translate("HeaderSelectMetadataPathHelp"), - enableNetworkSharePath: !0 - }) - }) - }), $(".librarySettingsForm").off("submit", onSubmit).on("submit", onSubmit), view.addEventListener("viewshow", function() { + $(".librarySettingsForm").off("submit", onSubmit).on("submit", onSubmit), view.addEventListener("viewshow", function() { libraryMenu.setTabs("librarysetup", 4, getTabs), loading.show(); var page = this; ApiClient.getServerConfiguration().then(function(config) { diff --git a/src/dashboardgeneral.html b/src/dashboardgeneral.html index 16d170e62b..a31db79d66 100644 --- a/src/dashboardgeneral.html +++ b/src/dashboardgeneral.html @@ -34,7 +34,7 @@