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";
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
}
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")
})
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");
});
};
});