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",
"version": "4.11.40",
"version": "4.11.41",
"author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0",
"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
*/
function handleDragOver(type, ev) {
function handleDragOver(ev) {
ev.preventDefault();
// TODO display a drag-drop allowed hint
}
/**
* @param {string} type
* @param {JQuery.DropEvent<HTMLElement, undefined, HTMLElement, HTMLElement>} ev
*/
function handleDrop(type, ev) {
function handleDrop(ev) {
ev.preventDefault();
if (!$('[name="upload_testdata"]').length) {
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]);
}
}
handleClickUpload(type, files);
handleClickUpload(files);
}
const clip = new Clipboard('.home-files .col--name', {