mirror of
https://github.com/storytold/spark.git
synced 2026-10-18 00:22:59 +00:00
Make viewer drop zone to cover the whole page window
This commit is contained in:
@@ -230,18 +230,19 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Handle drag and drop files.
|
// Handle drag and drop files.
|
||||||
const dropZoneEl = document.querySelector('.drop-zone');
|
const dropZoneEl = document.querySelector('.container');
|
||||||
|
const dropUIEl = document.querySelector('.drop-zone');
|
||||||
const onDragover = function (e) {
|
const onDragover = function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
dropZoneEl.classList.add('dragover');
|
dropUIEl.classList.add('dragover');
|
||||||
};
|
};
|
||||||
const onDragLeave = function () {
|
const onDragLeave = function () {
|
||||||
dropZoneEl.classList.remove('dragover');
|
dropUIEl.classList.remove('dragover');
|
||||||
};
|
};
|
||||||
const onDrop = function (e) {
|
const onDrop = function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
dropZoneEl.classList.remove('dragover');
|
dropUIEl.classList.remove('dragover');
|
||||||
dropZoneEl.classList.add('drop');
|
dropUIEl.classList.add('drop');
|
||||||
|
|
||||||
const files = e.dataTransfer.files;
|
const files = e.dataTransfer.files;
|
||||||
if (files.length > 0) {
|
if (files.length > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user