From f50c870916981913138fc38573107f16e367a88b Mon Sep 17 00:00:00 2001 From: Til Schmitter Date: Mon, 25 May 2026 00:46:27 +0200 Subject: [PATCH] priorotize bbox image loading when hash is given --- copyparty/web/baguettebox.js | 3 +++ copyparty/web/browser.css | 5 +++++ copyparty/web/browser.js | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/copyparty/web/baguettebox.js b/copyparty/web/baguettebox.js index b1f12792..026514b0 100644 --- a/copyparty/web/baguettebox.js +++ b/copyparty/web/baguettebox.js @@ -742,6 +742,8 @@ window.baguetteBox = (function () { } function showOverlay(chosenImageIndex) { + clmod(ebi('ggrid'), 'waiting', true); + if (options.noScrollbars) { var a = document.documentElement.style.overflowY, b = document.body.style.overflowY; @@ -765,6 +767,7 @@ window.baguetteBox = (function () { loadImage(currentIndex, function () { preloadNext(currentIndex); preloadPrev(currentIndex); + clmod(ebi('ggrid'), 'waiting', false); }); show_buttons(0); diff --git a/copyparty/web/browser.css b/copyparty/web/browser.css index b41f2b10..0151c3e3 100644 --- a/copyparty/web/browser.css +++ b/copyparty/web/browser.css @@ -4132,6 +4132,11 @@ html.e #wrap.thin .ghead { display: none; } } + +/* prevent load of new thumbnails */ +#ggrid.waiting a:not(.thumbed) img { + display: none; +} @supports (display: grid) and (gap: 1em) { #ggrid { display: grid; diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 0f0d559b..f66401f6 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -8762,6 +8762,10 @@ var treectl = (function () { vbar.onresize(); showfile.addlinks(); drag.initfiles(); + + var media = scan_hash(location.hash); + if(media && media[0] == 'g') + clmod(ebi('ggrid'), 'waiting', true); setTimeout(eval_hash, 1); };