From f9b6b10ef4ed1c979fc4734a0ac40007e79e6c20 Mon Sep 17 00:00:00 2001 From: grafixeyehero Date: Tue, 8 Oct 2019 01:28:30 +0300 Subject: [PATCH] wizardremoteaccess.js --- src/controllers/wizardremoteaccess.js | 40 ++++++++++++++++----------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/src/controllers/wizardremoteaccess.js b/src/controllers/wizardremoteaccess.js index 6856e0074f..554a417e57 100644 --- a/src/controllers/wizardremoteaccess.js +++ b/src/controllers/wizardremoteaccess.js @@ -1,31 +1,39 @@ -define(["loading", "emby-checkbox", "emby-button", "emby-select"], function(loading) { +define(["loading", "emby-checkbox", "emby-button", "emby-select"], function (loading) { "use strict"; function save(page) { loading.show(); - var apiClient = ApiClient, - config = {}; - config.EnableRemoteAccess = page.querySelector("#chkRemoteAccess").checked, config.EnableAutomaticPortMapping = page.querySelector("#chkEnableUpnp").checked, apiClient.ajax({ + var apiClient = ApiClient; + var config = {}; + config.EnableRemoteAccess = page.querySelector("#chkRemoteAccess").checked; + config.EnableAutomaticPortMapping = page.querySelector("#chkEnableUpnp").checked; + apiClient.ajax({ type: "POST", data: config, url: apiClient.getUrl("Startup/RemoteAccess") - }).then(function() { - loading.hide(), navigateToNextPage() - }) + }).then(function () { + loading.hide(); + navigateToNextPage(); + }); } function navigateToNextPage() { - Dashboard.navigate("wizardfinish.html") + Dashboard.navigate("wizardfinish.html"); } function onSubmit(e) { - return save(this), e.preventDefault(), !1 - } - return function(view, params) { - view.querySelector(".wizardSettingsForm").addEventListener("submit", onSubmit), view.addEventListener("viewshow", function() { - document.querySelector(".skinHeader").classList.add("noHomeButtonHeader") - }), view.addEventListener("viewhide", function() { - document.querySelector(".skinHeader").classList.remove("noHomeButtonHeader") - }) + save(this); + e.preventDefault(); + return false; } + + return function (view, params) { + view.querySelector(".wizardSettingsForm").addEventListener("submit", onSubmit); + view.addEventListener("viewshow", function () { + document.querySelector(".skinHeader").classList.add("noHomeButtonHeader"); + }); + view.addEventListener("viewhide", function () { + document.querySelector(".skinHeader").classList.remove("noHomeButtonHeader"); + }); + }; });