From 307e66428609f5c116b975df03d4b93b21925ae6 Mon Sep 17 00:00:00 2001 From: grafixeyehero Date: Tue, 8 Oct 2019 01:30:21 +0300 Subject: [PATCH] wizardagreement.js --- src/scripts/wizardagreement.js | 36 ++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/src/scripts/wizardagreement.js b/src/scripts/wizardagreement.js index 77c12fb664..148b0ef39a 100644 --- a/src/scripts/wizardagreement.js +++ b/src/scripts/wizardagreement.js @@ -1,17 +1,27 @@ -define(["dom", "emby-button"], function(dom) { +define(["dom", "emby-button"], function (dom) { "use strict"; function onSubmit(e) { - return dom.parentWithClass(this, "page").querySelector(".chkAccept").checked ? Dashboard.navigate("wizardfinish.html") : Dashboard.alert({ - message: Globalize.translate("MessagePleaseAcceptTermsOfServiceBeforeContinuing"), - title: "" - }), e.preventDefault(), !1 + if (dom.parentWithClass(this, "page").querySelector(".chkAccept").checked) { + Dashboard.navigate("wizardfinish.html"); + } else { + Dashboard.alert({ + message: Globalize.translate("MessagePleaseAcceptTermsOfServiceBeforeContinuing"), + title: "" + }); + } + + e.preventDefault(); + return false; } - return function(view, params) { - view.querySelector(".wizardAgreementForm").addEventListener("submit", onSubmit), view.addEventListener("viewshow", function() { - document.querySelector(".skinHeader").classList.add("noHomeButtonHeader") - }), view.addEventListener("viewhide", function() { - document.querySelector(".skinHeader").classList.remove("noHomeButtonHeader") - }) - } -}); \ No newline at end of file + + return function (view, params) { + view.querySelector(".wizardAgreementForm").addEventListener("submit", onSubmit); + view.addEventListener("viewshow", function () { + document.querySelector(".skinHeader").classList.add("noHomeButtonHeader"); + }); + view.addEventListener("viewhide", function () { + document.querySelector(".skinHeader").classList.remove("noHomeButtonHeader"); + }); + }; +});