X-Git-Url: https://git-public.kairo.at/?p=authserver.git;a=blobdiff_plain;f=app%2Fauthsystem.js;h=6ab6a14e9564e34ea772dd9030ec1886b096de78;hp=7a24d84af4b5efde87be187e217d3256c78ffedf;hb=2b9aa8f3c5aeb5d3fa414a985ad14b351a12cfcd;hpb=04116cc5dabb951023fb511fda0dc36956d6a84a diff --git a/app/authsystem.js b/app/authsystem.js index 7a24d84..6ab6a14 100644 --- a/app/authsystem.js +++ b/app/authsystem.js @@ -2,7 +2,11 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ -window.onload = function() { +// Call initElements at the earliest possible stage after parsing the document. +if (window.addEventListener) { window.addEventListener("DOMContentLoaded", initElements, false); } +else { window.onload = initElements(); } + +function initElements() { var jsWarning = document.getElementById("jswarning"); if (jsWarning) { if (jsWarning.classList) { @@ -27,7 +31,7 @@ window.onload = function() { if (cancelAuth) { cancelAuth.onclick = function() { document.getElementById("isauthorized").value = "no"; - document.getElementById("loginauthform").submit(); + document.getElementById("authform").submit(); } } var addAnotherEmail = document.getElementById("addanotheremail");