From 21ef841c5bdb6462bceb5920485546089cab2f53 Mon Sep 17 00:00:00 2001 From: undefined Date: Sun, 27 Jun 2021 23:32:33 +0800 Subject: [PATCH] ui: files: fix drag&drop --- packages/ui-default/package.json | 2 +- packages/ui-default/pages/home_files.page.js | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/ui-default/package.json b/packages/ui-default/package.json index 05b1dadf6..360526830 100644 --- a/packages/ui-default/package.json +++ b/packages/ui-default/package.json @@ -1,6 +1,6 @@ { "name": "@hydrooj/ui-default", - "version": "4.11.40", + "version": "4.11.41", "author": "undefined ", "license": "AGPL-3.0", "main": "hydro.js", diff --git a/packages/ui-default/pages/home_files.page.js b/packages/ui-default/pages/home_files.page.js index dc95b11a0..c52553b58 100644 --- a/packages/ui-default/pages/home_files.page.js +++ b/packages/ui-default/pages/home_files.page.js @@ -119,19 +119,17 @@ const page = new NamedPage('home_files', () => { } /** - * @param {string} type * @param {JQuery.DragOverEvent} ev */ - function handleDragOver(type, ev) { + function handleDragOver(ev) { ev.preventDefault(); // TODO display a drag-drop allowed hint } /** - * @param {string} type * @param {JQuery.DropEvent} 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', {