Skip to content
Snippets Groups Projects
Commit d2d5c75b authored by Tim van Dijen's avatar Tim van Dijen
Browse files

Rewrite JS in ES5 compatible manner

parent 927407c6
No related branches found
No related tags found
No related merge requests found
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<p>{{ 'A service has requested you to authenticate yourself. Please enter your username and password in the form below.'|trans }}</p> <p>{{ 'A service has requested you to authenticate yourself. Please enter your username and password in the form below.'|trans }}</p>
<br> <br>
<div class="center"> <div class="center">
<form class="pure-form pure-form-aligned center-form" action="{{ moduleURL('core/loginuserpass', {'AuthState': AuthState}) }}" method="post" name="f"> <form id="f" class="pure-form pure-form-aligned center-form" action="{{ moduleURL('core/loginuserpass', {'AuthState': AuthState}) }}" method="post" name="f">
<div class="form-align"> <div class="form-align">
<div class="pure-control-group"> <div class="pure-control-group">
......
$(document).ready(function () { window.readyHandlers = [];
$('#submit_button').on('click', function () { window.ready = function ready(handler) {
$(this).attr('disabled', 'disabled'); window.readyHandlers.push(handler);
$(this).html($(this).data('processing')); handleState();
$(this).parents('form').submit(); };
});
window.handleState = function handleState () {
if (document.readyState === 'interactive' || document.readyState === "complete") {
while(window.readyHandlers.length > 0) {
(window.readyHandlers.shift())();
}
}
};
document.onreadystatechange = window.handleState;
ready(function () {
// your code here
var button = document.getElementById("submit_button");
button.onclick = function () {
this.innerHTML = button.getAttribute("data-processing");;
this.disabled = true;
var form = document.getElementById("f");
form.submit();
return true;
};
}); });
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment