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
This commit is contained in:
ed 2023-08-16 19:56:47 +00:00
parent 015b87ee99
commit 5d13ebb4ac

View file

@ -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;