From 7a05108a5114e4f6852a261126cc4b6e97ae494e Mon Sep 17 00:00:00 2001 From: stackxp Date: Wed, 24 Dec 2025 13:30:29 +0100 Subject: [PATCH] Fix Chrome double-click behavior --- copyparty/web/browser.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 4a3bf4a0..9e03ca03 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -9622,8 +9622,8 @@ var rcm = (function () { clmod(ebi('rpst'), 'hide', !has_clip); clmod(ebi('rs3'), 'hide', !has_sel || !has_clip); - menu.style.left = x + 1 + 'px'; - menu.style.top = y + 1 + 'px'; + menu.style.left = x + 5 + 'px'; + menu.style.top = y + 5 + 'px'; menu.style.display = 'block'; menu.focus(); } @@ -9638,14 +9638,17 @@ var rcm = (function () { menu.style.display = ''; } + var lrcTime = null; ebi('wrap').oncontextmenu = function(e) { hide(true); - console.log(e.detail) - if (thegrid.en || !r.enabled || (r.double && e.detail > 1)) + if (thegrid.en || !r.enabled || (r.double && lrcTime && e.timeStamp - lrcTime < 500)) { return true; - ev(e); - show(e.x, e.y, e.target); - return false; + } else { + lrcTime = e.timeStamp; + ev(e); + show(e.clientX, e.clientY, e.target); + return false; + } }; menu.onblur = function() {setTimeout(hide)};