* 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 = document.getElementById('dropzone');
|
||||||
|
|
||||||
dropzone.addEventListener('dragover', function(e) {
|
dropzone.addEventListener('dragover', function(e) {
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
this.classList.remove('nodrop');
|
this.classList.remove('nodrop');
|
||||||
this.classList.add('drop');
|
this.classList.add('drop');
|
||||||
});
|
});
|
||||||
|
|
||||||
dropzone.addEventListener('dragleave', function(e) {
|
dropzone.addEventListener('dragleave', function(e) {
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
this.classList.remove('drop');
|
this.classList.remove('drop');
|
||||||
this.classList.add('nodrop');
|
this.classList.add('nodrop');
|
||||||
});
|
});
|
||||||
|
|
||||||
dropzone.addEventListener('click', function(e) {
|
dropzone.addEventListener('mousedown', function(e) {
|
||||||
e.preventDefault();
|
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 = document.createElement('input');
|
||||||
input.type = 'file';
|
input.type = 'file';
|
||||||
input.click();
|
input.click();
|
||||||
|
|
Loading…
Reference in New Issue