From 5d13ebb4ac404ac0a0fb707610ec0ea0988678a1 Mon Sep 17 00:00:00 2001 From: ed Date: Wed, 16 Aug 2023 19:56:47 +0000 Subject: [PATCH] avoid firefox-android quirk(?): when repeatedly tapping the next-folder button, occasionally it will reload the entire page instead of ajax'ing the directory contents. Navigation happens by simulating a click in the directory sidebar, so the incorrect behavior matches what would happen if the link to the folder didn't have its onclick-handler attached, so should probably double-check if there's some way for that to happen Issue observed fairly easily in firefox on android, regardless if copyparty is running locally or on a server in a different country. Unable to reproduce with android-chrome or desktop-firefox Could also be due to an addon (dark-reader, noscript, ublock-origin) anyways, avoiding this by doing the navigation more explicitly --- copyparty/web/browser.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 43f6c59e..15c78bc3 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -4618,8 +4618,7 @@ function tree_neigh(n) { if (act >= links.length) act = 0; - treectl.dir_cb = tree_scrollto; - links[act].click(); + treectl.treego.call(links[act]); links[act].focus(); } @@ -4638,7 +4637,7 @@ function tree_up(justgo) { return; } if (act.previousSibling.textContent == '-') { - act.previousSibling.click(); + treectl.treego.call(act.previousSibling); if (!justgo) return; } @@ -5569,7 +5568,7 @@ var treectl = (function () { } links[a].className = cl; - links[a].onclick = treego; + links[a].onclick = r.treego; links[a].onmouseenter = nowrap ? menter : null; links[a].onmouseleave = nowrap ? mleave : null; } @@ -5631,7 +5630,7 @@ var treectl = (function () { return els[a].click(); } - function treego(e) { + r.treego = function (e) { if (ctrl(e)) return true;