Suppress item activation after drag drop

This commit is contained in:
Mikei386
2026-06-23 12:11:06 +02:00
parent 50c685ee80
commit 9b12e0d150
5 changed files with 18 additions and 4 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
set -eu
PLUGIN="u-navigator"
VERSION="2026.06.23.r024"
VERSION="2026.06.23.r025"
PKG_DIR="packages"
WORK_DIR=".plugin-build"
PKG_NAME="${PLUGIN}-${VERSION}.tgz"
Binary file not shown.
Binary file not shown.
+15 -1
View File
@@ -13,6 +13,7 @@ const state = {
draggedEntry: null,
pointerDrag: null,
suppressClickPath: null,
suppressItemActivationUntil: 0,
debug: [],
nextDebugId: 1,
jobs: new Map(),
@@ -276,8 +277,12 @@ function renderExplorer(body, win) {
lockExplorerScroll(win, body);
startItemPointerDrag(event, win, entry);
});
row.addEventListener('click', () => selectEntry(win, entry, body));
row.addEventListener('click', () => {
if (shouldSuppressItemActivation()) return;
selectEntry(win, entry, body);
});
row.addEventListener('dblclick', () => {
if (shouldSuppressItemActivation()) return;
if (entry.type === 'directory') {
loadExplorer(win, entry.path);
}
@@ -785,6 +790,14 @@ function selectEntry(win, entry, scrollBody = null) {
restoreExplorerScroll(win, scrollBody);
}
function shouldSuppressItemActivation() {
if (Date.now() <= state.suppressItemActivationUntil) {
recordDebug('item.activation.suppressed', { until: state.suppressItemActivationUntil });
return true;
}
return false;
}
function focusWindow(win) {
state.focusedId = win.id;
win.zIndex = ++state.zIndex;
@@ -879,6 +892,7 @@ async function finishItemPointerDrag(event, move, up) {
event.preventDefault();
state.suppressClickPath = drag.path;
state.suppressItemActivationUntil = Date.now() + 450;
const target = findPointerDropTarget(event);
recordDebug('pointer.finish', {
source: drag.path,
+2 -2
View File
@@ -1,7 +1,7 @@
<!DOCTYPE PLUGIN [
<!ENTITY name "u-navigator">
<!ENTITY author "Michael Roll">
<!ENTITY version "2026.06.23.r024">
<!ENTITY version "2026.06.23.r025">
<!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>460c859d05c48638ba4c30e51e040b65</MD5>
<MD5>e5c7cd67da544ca809a683f12093652e</MD5>
</FILE>
<FILE Run="/bin/bash">