aboutsummaryrefslogtreecommitdiffstats
path: root/core/js/publicshareauth.js
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-01-14 18:59:18 +0100
committerJoas Schilling <coding@schilljs.com>2020-02-06 20:41:42 +0100
commitdd919668cb2b85ec7a35782b0e5a2b64eed14e30 (patch)
tree20af122829df39b9b43b112ee01b904463f39652 /core/js/publicshareauth.js
parentd2d7e37b7bf00ea7929da02459e4abb8640d064a (diff)
downloadnextcloud-server-dd919668cb2b85ec7a35782b0e5a2b64eed14e30.tar.gz
nextcloud-server-dd919668cb2b85ec7a35782b0e5a2b64eed14e30.zip
No more jQuery
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'core/js/publicshareauth.js')
-rw-r--r--core/js/publicshareauth.js18
1 files changed, 10 insertions, 8 deletions
diff --git a/core/js/publicshareauth.js b/core/js/publicshareauth.js
index 7f3f0d0a7d4..af061954506 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);
});