* unnötige preventDefault() entfernt

* optisches Klick-Feedback hinzugefügt
This commit is contained in:
root 2023-03-23 16:47:00 +00:00
parent 125ee53fe2
commit 891565f76c
1 changed files with 12 additions and 6 deletions

View File

@ -1,22 +1,28 @@
dropzone = document.getElementById('dropzone');
dropzone.addEventListener('dragover', function(e) {
e.preventDefault();
this.classList.remove('nodrop');
this.classList.add('drop');
});
dropzone.addEventListener('dragleave', function(e) {
e.preventDefault();
this.classList.remove('drop');
this.classList.add('nodrop');
});
dropzone.addEventListener('click', function(e) {
e.preventDefault();
dropzone.addEventListener('mousedown', function(e) {
this.classList.remove('nodrop');
this.classList.add('drop');
console.log('click');
});
dropzone.addEventListener('mouseup', function(e) {
this.classList.remove('drop');
this.classList.add('nodrop');
console.log('unclick');
});
dropzone.addEventListener('click', function(e) {
input = document.createElement('input');
input.type = 'file';
input.click();