Fix context menu and internal drops
This commit is contained in:
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
PLUGIN="u-navigator"
|
PLUGIN="u-navigator"
|
||||||
VERSION="0.2.3"
|
VERSION="0.2.4"
|
||||||
PKG_DIR="packages"
|
PKG_DIR="packages"
|
||||||
WORK_DIR=".plugin-build"
|
WORK_DIR=".plugin-build"
|
||||||
PKG_NAME="${PLUGIN}-${VERSION}.tgz"
|
PKG_NAME="${PLUGIN}-${VERSION}.tgz"
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -224,16 +224,19 @@ function renderExplorer(body, win) {
|
|||||||
row.addEventListener('dragover', (event) => {
|
row.addEventListener('dragover', (event) => {
|
||||||
if (entry.type === 'directory') {
|
if (entry.type === 'directory') {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
event.dataTransfer.dropEffect = event.altKey ? 'copy' : 'move';
|
event.dataTransfer.dropEffect = event.altKey ? 'copy' : 'move';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
row.addEventListener('drop', async (event) => {
|
row.addEventListener('drop', async (event) => {
|
||||||
if (entry.type !== 'directory') return;
|
if (entry.type !== 'directory') return;
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
await handleDrop(event, win, entry.path);
|
await handleDrop(event, win, entry.path);
|
||||||
});
|
});
|
||||||
row.addEventListener('contextmenu', (event) => {
|
row.addEventListener('contextmenu', (event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
selectEntry(win, entry);
|
selectEntry(win, entry);
|
||||||
showContextMenu(event, win, entry);
|
showContextMenu(event, win, entry);
|
||||||
});
|
});
|
||||||
@@ -320,7 +323,7 @@ async function handleDrop(event, win, targetPath) {
|
|||||||
return;
|
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) {
|
if (internalPath) {
|
||||||
const name = internalPath.split('/').filter(Boolean).at(-1);
|
const name = internalPath.split('/').filter(Boolean).at(-1);
|
||||||
const destination = `${targetPath.replace(/\/$/, '')}/${name}`;
|
const destination = `${targetPath.replace(/\/$/, '')}/${name}`;
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE PLUGIN [
|
<!DOCTYPE PLUGIN [
|
||||||
<!ENTITY name "u-navigator">
|
<!ENTITY name "u-navigator">
|
||||||
<!ENTITY author "michael">
|
<!ENTITY author "michael">
|
||||||
<!ENTITY version "0.2.3">
|
<!ENTITY version "0.2.4">
|
||||||
<!ENTITY package "&name;-&version;.tgz">
|
<!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">
|
<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;">
|
<FILE Name="/boot/config/plugins/&name;/&package;">
|
||||||
<URL>https://git.casaderoll.de/michael/Unraid-Navigator/raw/branch/main/packages/&package;</URL>
|
<URL>https://git.casaderoll.de/michael/Unraid-Navigator/raw/branch/main/packages/&package;</URL>
|
||||||
<MD5>8d05b440bd2ad3e20b8d900238642c3f</MD5>
|
<MD5>5574cd115432aaf1b2b34f77a0f89809</MD5>
|
||||||
</FILE>
|
</FILE>
|
||||||
|
|
||||||
<FILE Run="/bin/bash">
|
<FILE Run="/bin/bash">
|
||||||
|
|||||||
Reference in New Issue
Block a user