* unnötige preventDefault() entfernt
* optisches Klick-Feedback hinzugefügt
This commit is contained in:
parent
125ee53fe2
commit
891565f76c
18
script.js
18
script.js
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue