From dae82514dc7fd6600650bbf29945691da1c256a5 Mon Sep 17 00:00:00 2001 From: hayabusa <10593623+m-hayabusa@users.noreply.github.com> Date: Thu, 13 Oct 2022 08:34:23 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=80=E9=83=A8=E3=81=AE=E7=8A=B6?= =?UTF-8?q?=E6=85=8B=E3=81=AE=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=82=92?= =?UTF-8?q?=E3=83=89=E3=83=AD=E3=83=83=E3=83=97=E3=81=97=E3=81=A6=E3=82=A2?= =?UTF-8?q?=E3=83=83=E3=83=97=E3=83=AD=E3=83=BC=E3=83=89=E3=81=A7=E3=81=8D?= =?UTF-8?q?=E3=81=AA=E3=81=84=E5=A0=B4=E5=90=88=E3=81=8C=E3=81=82=E3=82=8B?= =?UTF-8?q?=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3=20(=E6=8A=95?= =?UTF-8?q?=E7=A8=BF=E3=83=95=E3=82=A9=E3=83=BC=E3=83=A0=E4=BB=A5=E5=A4=96?= =?UTF-8?q?=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6=E3=82=82)=20(#9114)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * dropEffectとeffectAllowedの関連付けを投稿フォームと同様に修正 * 文字列をDropできるようにしてしまったのを修正 --- .../client/src/components/MkDrive.folder.vue | 17 ++++++++++++++++- .../client/src/components/MkDrive.navFolder.vue | 17 ++++++++++++++++- packages/client/src/components/MkDrive.vue | 17 ++++++++++++++++- .../src/pages/messaging/messaging-room.form.vue | 17 ++++++++++++++++- .../src/pages/messaging/messaging-room.vue | 17 ++++++++++++++++- 5 files changed, 80 insertions(+), 5 deletions(-) diff --git a/packages/client/src/components/MkDrive.folder.vue b/packages/client/src/components/MkDrive.folder.vue index e55fa4f0f2..6c522c0862 100644 --- a/packages/client/src/components/MkDrive.folder.vue +++ b/packages/client/src/components/MkDrive.folder.vue @@ -90,7 +90,22 @@ function onDragover(ev: DragEvent) { const isDriveFolder = ev.dataTransfer.types[0] === _DATA_TRANSFER_DRIVE_FOLDER_; if (isFile || isDriveFile || isDriveFolder) { - ev.dataTransfer.dropEffect = ev.dataTransfer.effectAllowed === 'all' ? 'copy' : 'move'; + switch (ev.dataTransfer.effectAllowed) { + case 'all': + case 'uninitialized': + case 'copy': + case 'copyLink': + case 'copyMove': + ev.dataTransfer.dropEffect = 'copy'; + break; + case 'linkMove': + case 'move': + ev.dataTransfer.dropEffect = 'move'; + break; + default: + ev.dataTransfer.dropEffect = 'none'; + break; + } } else { ev.dataTransfer.dropEffect = 'none'; } diff --git a/packages/client/src/components/MkDrive.navFolder.vue b/packages/client/src/components/MkDrive.navFolder.vue index 5482703317..455c14f95e 100644 --- a/packages/client/src/components/MkDrive.navFolder.vue +++ b/packages/client/src/components/MkDrive.navFolder.vue @@ -58,7 +58,22 @@ function onDragover(ev: DragEvent) { const isDriveFolder = ev.dataTransfer.types[0] === _DATA_TRANSFER_DRIVE_FOLDER_; if (isFile || isDriveFile || isDriveFolder) { - ev.dataTransfer.dropEffect = ev.dataTransfer.effectAllowed === 'all' ? 'copy' : 'move'; + switch (ev.dataTransfer.effectAllowed) { + case 'all': + case 'uninitialized': + case 'copy': + case 'copyLink': + case 'copyMove': + ev.dataTransfer.dropEffect = 'copy'; + break; + case 'linkMove': + case 'move': + ev.dataTransfer.dropEffect = 'move'; + break; + default: + ev.dataTransfer.dropEffect = 'none'; + break; + } } else { ev.dataTransfer.dropEffect = 'none'; } diff --git a/packages/client/src/components/MkDrive.vue b/packages/client/src/components/MkDrive.vue index 002ca58d04..c79ab97000 100644 --- a/packages/client/src/components/MkDrive.vue +++ b/packages/client/src/components/MkDrive.vue @@ -196,7 +196,22 @@ function onDragover(ev: DragEvent): any { const isDriveFile = ev.dataTransfer.types[0] === _DATA_TRANSFER_DRIVE_FILE_; const isDriveFolder = ev.dataTransfer.types[0] === _DATA_TRANSFER_DRIVE_FOLDER_; if (isFile || isDriveFile || isDriveFolder) { - ev.dataTransfer.dropEffect = ev.dataTransfer.effectAllowed === 'all' ? 'copy' : 'move'; + switch (ev.dataTransfer.effectAllowed) { + case 'all': + case 'uninitialized': + case 'copy': + case 'copyLink': + case 'copyMove': + ev.dataTransfer.dropEffect = 'copy'; + break; + case 'linkMove': + case 'move': + ev.dataTransfer.dropEffect = 'move'; + break; + default: + ev.dataTransfer.dropEffect = 'none'; + break; + } } else { ev.dataTransfer.dropEffect = 'none'; } diff --git a/packages/client/src/pages/messaging/messaging-room.form.vue b/packages/client/src/pages/messaging/messaging-room.form.vue index 38bab90502..4589069df0 100644 --- a/packages/client/src/pages/messaging/messaging-room.form.vue +++ b/packages/client/src/pages/messaging/messaging-room.form.vue @@ -93,7 +93,22 @@ function onDragover(ev: DragEvent) { const isDriveFile = ev.dataTransfer.types[0] === _DATA_TRANSFER_DRIVE_FILE_; if (isFile || isDriveFile) { ev.preventDefault(); - ev.dataTransfer.dropEffect = ev.dataTransfer.effectAllowed === 'all' ? 'copy' : 'move'; + switch (ev.dataTransfer.effectAllowed) { + case 'all': + case 'uninitialized': + case 'copy': + case 'copyLink': + case 'copyMove': + ev.dataTransfer.dropEffect = 'copy'; + break; + case 'linkMove': + case 'move': + ev.dataTransfer.dropEffect = 'move'; + break; + default: + ev.dataTransfer.dropEffect = 'none'; + break; + } } } diff --git a/packages/client/src/pages/messaging/messaging-room.vue b/packages/client/src/pages/messaging/messaging-room.vue index a9da89ed95..37d4145ee8 100644 --- a/packages/client/src/pages/messaging/messaging-room.vue +++ b/packages/client/src/pages/messaging/messaging-room.vue @@ -154,7 +154,22 @@ function onDragover(ev: DragEvent) { const isDriveFile = ev.dataTransfer.types[0] === _DATA_TRANSFER_DRIVE_FILE_; if (isFile || isDriveFile) { - ev.dataTransfer.dropEffect = ev.dataTransfer.effectAllowed === 'all' ? 'copy' : 'move'; + switch (ev.dataTransfer.effectAllowed) { + case 'all': + case 'uninitialized': + case 'copy': + case 'copyLink': + case 'copyMove': + ev.dataTransfer.dropEffect = 'copy'; + break; + case 'linkMove': + case 'move': + ev.dataTransfer.dropEffect = 'move'; + break; + default: + ev.dataTransfer.dropEffect = 'none'; + break; + } } else { ev.dataTransfer.dropEffect = 'none'; }