From dd919668cb2b85ec7a35782b0e5a2b64eed14e30 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 14 Jan 2020 18:59:18 +0100 Subject: [PATCH] No more jQuery Signed-off-by: Joas Schilling --- core/js/publicshareauth.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/core/js/publicshareauth.js b/core/js/publicshareauth.js index 7f3f0d0a7d..af06195450 100644 --- a/core/js/publicshareauth.js +++ b/core/js/publicshareauth.js @@ -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); });