Suppress item activation after drag drop
This commit is contained in:
+1
-1
@@ -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
@@ -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
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user