ui: files: fix drag&drop

This commit is contained in:
undefined committed 2021-06-27 23:32:33 +08:00
1 parent 1139c0ea57
commit 21ef841c5b
2 files changed
+4 -6

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@hydrooj/ui-default", "name": "@hydrooj/ui-default",
"version": "4.11.40", "version": "4.11.41",
"author": "undefined <i@undefined.moe>", "author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"main": "hydro.js", "main": "hydro.js",
+3 -5
View File
@@ -119,19 +119,17 @@ const page = new NamedPage('home_files', () => {
} }
/** /**
* @param {string} type
* @param {JQuery.DragOverEvent<HTMLElement, undefined, HTMLElement, HTMLElement>} ev * @param {JQuery.DragOverEvent<HTMLElement, undefined, HTMLElement, HTMLElement>} ev
*/ */
function handleDragOver(type, ev) { function handleDragOver(ev) {
ev.preventDefault(); ev.preventDefault();
// TODO display a drag-drop allowed hint // TODO display a drag-drop allowed hint
} }
/** /**
* @param {string} type
* @param {JQuery.DropEvent<HTMLElement, undefined, HTMLElement, HTMLElement>} ev * @param {JQuery.DropEvent<HTMLElement, undefined, HTMLElement, HTMLElement>} ev
*/ */
function handleDrop(type, ev) { function handleDrop(ev) {
ev.preventDefault(); ev.preventDefault();
if (!$('[name="upload_testdata"]').length) { if (!$('[name="upload_testdata"]').length) {
Notification.error(i18n("You don't have permission to upload file.")); Notification.error(i18n("You don't have permission to upload file."));
@@ -151,7 +149,7 @@ const page = new NamedPage('home_files', () => {
files.push(ev.dataTransfer.files[i]); files.push(ev.dataTransfer.files[i]);
} }
} }
handleClickUpload(type, files); handleClickUpload(files);
} }
const clip = new Clipboard('.home-files .col--name', { const clip = new Clipboard('.home-files .col--name', {