Fix same-window folder drop target detection
This commit is contained in:
+1
-1
@@ -2,7 +2,7 @@
|
||||
set -eu
|
||||
|
||||
PLUGIN="u-navigator"
|
||||
VERSION="2026.07.14.r012"
|
||||
VERSION="2026.07.14.r013"
|
||||
PKG_DIR="packages"
|
||||
WORK_DIR=".plugin-build"
|
||||
PKG_NAME="${PLUGIN}-${VERSION}.tgz"
|
||||
|
||||
Binary file not shown.
+14
-4
@@ -2283,16 +2283,17 @@ async function finishItemPointerDrag(event, move, up) {
|
||||
if (!drag) return;
|
||||
|
||||
markDraggingRows(drag.paths, false);
|
||||
state.pointerDrag = null;
|
||||
|
||||
if (!drag.active) {
|
||||
state.pointerDrag = null;
|
||||
return;
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
state.suppressClickPath = drag.path;
|
||||
state.suppressItemActivationUntil = Date.now() + 450;
|
||||
const target = findPointerDropTarget(event);
|
||||
const target = findPointerDropTarget(event, drag);
|
||||
state.pointerDrag = null;
|
||||
recordDebug('pointer.finish', {
|
||||
source: drag.path,
|
||||
sources: drag.paths,
|
||||
@@ -2378,7 +2379,7 @@ function clearPointerDropTarget() {
|
||||
}
|
||||
}
|
||||
|
||||
function findPointerDropTarget(event) {
|
||||
function findPointerDropTarget(event, drag = state.pointerDrag) {
|
||||
let element;
|
||||
let elements = [];
|
||||
try {
|
||||
@@ -2404,16 +2405,22 @@ function findPointerDropTarget(event) {
|
||||
const win = state.windows.find((item) => item.id === windowEl.dataset.windowId);
|
||||
if (!win || win.kind !== 'explorer') return null;
|
||||
|
||||
const drag = state.pointerDrag;
|
||||
let row = null;
|
||||
let overEntry = false;
|
||||
for (const candidate of elements) {
|
||||
try {
|
||||
const treeTarget = candidate.closest?.('.tree-label[data-tree-open]');
|
||||
if (treeTarget && treeTarget.closest?.('.window') === windowEl) {
|
||||
overEntry = true;
|
||||
}
|
||||
if (treeTarget && treeTarget.closest?.('.window') === windowEl && isValidPointerTargetPath(treeTarget.dataset.treeOpen, drag)) {
|
||||
row = treeTarget;
|
||||
break;
|
||||
}
|
||||
const candidateRow = candidate.closest?.('.file-row');
|
||||
if (candidateRow && candidateRow.closest?.('.window') === windowEl) {
|
||||
overEntry = true;
|
||||
}
|
||||
if (!candidateRow || candidateRow.dataset.type !== 'directory') {
|
||||
continue;
|
||||
}
|
||||
@@ -2435,6 +2442,9 @@ function findPointerDropTarget(event) {
|
||||
if (row) {
|
||||
return { windowId: win.id, path: row.dataset.path || row.dataset.treeOpen, row };
|
||||
}
|
||||
if (overEntry) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return { windowId: win.id, path: win.data.path, row: null };
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE PLUGIN [
|
||||
<!ENTITY name "u-navigator">
|
||||
<!ENTITY author "Michael Roll">
|
||||
<!ENTITY version "2026.07.14.r012">
|
||||
<!ENTITY version "2026.07.14.r013">
|
||||
<!ENTITY package "&name;-&version;.tgz">
|
||||
<!ENTITY pluginURL "https://git.casaderoll.de/michael/Unraid-Navigator/raw/branch/main/u-navigator.plg">
|
||||
<!ENTITY support "https://git.casaderoll.de/michael/Unraid-Navigator">
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
<FILE Name="/boot/config/plugins/&name;/&package;">
|
||||
<URL>https://git.casaderoll.de/michael/Unraid-Navigator/raw/branch/main/packages/&package;</URL>
|
||||
<MD5>bf8938f8ee7dfe21d4a87d014f59acc3</MD5>
|
||||
<MD5>eb8a765a5e07ff3a65b04b40b6f76fb5</MD5>
|
||||
</FILE>
|
||||
|
||||
<FILE Run="/bin/bash">
|
||||
|
||||
Reference in New Issue
Block a user