Merge pull request #18897 from nextcloud/bugfix/noid/no-more-jquery

No more jQuery
This commit is contained in:
Joas Schilling 2020-02-07 10:58:20 +01:00 committed by GitHub
commit fc18116715
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 8 deletions

View File

@ -1,9 +1,11 @@
$(document).ready(function(){
$('#password').on('keyup input change', function() {
if ($('#password').val().length > 0) {
$('#password-submit').prop('disabled', false);
} else {
$('#password-submit').prop('disabled', true);
}
});
document.addEventListener('DOMContentLoaded', function() {
var passwordInput = document.getElementById('password');
var passwordButton = document.getElementById('password-submit');
var eventListener = function() {
passwordButton.disabled = passwordInput.value.length === 0;
};
passwordInput.addEventListener('click', eventListener);
passwordInput.addEventListener('keyup', eventListener);
passwordInput.addEventListener('change', eventListener);
});