wizardagreement.js

This commit is contained in:
grafixeyehero 2019-10-08 01:30:21 +03:00
parent 678b558935
commit 307e664286

View File

@ -1,17 +1,27 @@
define(["dom", "emby-button"], function(dom) { define(["dom", "emby-button"], function (dom) {
"use strict"; "use strict";
function onSubmit(e) { function onSubmit(e) {
return dom.parentWithClass(this, "page").querySelector(".chkAccept").checked ? Dashboard.navigate("wizardfinish.html") : Dashboard.alert({ if (dom.parentWithClass(this, "page").querySelector(".chkAccept").checked) {
Dashboard.navigate("wizardfinish.html");
} else {
Dashboard.alert({
message: Globalize.translate("MessagePleaseAcceptTermsOfServiceBeforeContinuing"), message: Globalize.translate("MessagePleaseAcceptTermsOfServiceBeforeContinuing"),
title: "" title: ""
}), e.preventDefault(), !1 });
} }
return function(view, params) {
view.querySelector(".wizardAgreementForm").addEventListener("submit", onSubmit), view.addEventListener("viewshow", function() { e.preventDefault();
document.querySelector(".skinHeader").classList.add("noHomeButtonHeader") return false;
}), view.addEventListener("viewhide", function() {
document.querySelector(".skinHeader").classList.remove("noHomeButtonHeader")
})
} }
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");
});
};
}); });