mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-18 01:36:08 +08:00
ui: files: fix drag&drop
This commit is contained in:
1 parent
1139c0ea57
commit
21ef841c5b
2 files changed
+4
-6
No files matched your search
@@ -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",
|
||||
|
||||
@@ -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', {
|
||||
|
||||
Reference in new issue
Block a user