Fix context menu and internal drops

This commit is contained in:
Mikei386
2026-06-22 22:59:03 +02:00
parent f29ecb0be5
commit 9764421e13
5 changed files with 7 additions and 4 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
set -eu
PLUGIN="u-navigator"
VERSION="0.2.3"
VERSION="0.2.4"
PKG_DIR="packages"
WORK_DIR=".plugin-build"
PKG_NAME="${PLUGIN}-${VERSION}.tgz"
Binary file not shown.
Binary file not shown.
+4 -1
View File
@@ -224,16 +224,19 @@ function renderExplorer(body, win) {
row.addEventListener('dragover', (event) => {
if (entry.type === 'directory') {
event.preventDefault();
event.stopPropagation();
event.dataTransfer.dropEffect = event.altKey ? 'copy' : 'move';
}
});
row.addEventListener('drop', async (event) => {
if (entry.type !== 'directory') return;
event.preventDefault();
event.stopPropagation();
await handleDrop(event, win, entry.path);
});
row.addEventListener('contextmenu', (event) => {
event.preventDefault();
event.stopPropagation();
selectEntry(win, entry);
showContextMenu(event, win, entry);
});
@@ -320,7 +323,7 @@ async function handleDrop(event, win, targetPath) {
return;
}
const internalPath = event.dataTransfer.getData('application/x-u-navigator-path');
const internalPath = event.dataTransfer.getData('application/x-u-navigator-path') || event.dataTransfer.getData('text/plain');
if (internalPath) {
const name = internalPath.split('/').filter(Boolean).at(-1);
const destination = `${targetPath.replace(/\/$/, '')}/${name}`;
+2 -2
View File
@@ -1,7 +1,7 @@
<!DOCTYPE PLUGIN [
<!ENTITY name "u-navigator">
<!ENTITY author "michael">
<!ENTITY version "0.2.3">
<!ENTITY version "0.2.4">
<!ENTITY package "&name;-&version;.tgz">
]>
<PLUGIN name="&name;" author="&author;" version="&version;" pluginURL="https://git.casaderoll.de/michael/Unraid-Navigator/raw/branch/main/u-navigator.plg">
@@ -14,7 +14,7 @@
<FILE Name="/boot/config/plugins/&name;/&package;">
<URL>https://git.casaderoll.de/michael/Unraid-Navigator/raw/branch/main/packages/&package;</URL>
<MD5>8d05b440bd2ad3e20b8d900238642c3f</MD5>
<MD5>5574cd115432aaf1b2b34f77a0f89809</MD5>
</FILE>
<FILE Run="/bin/bash">