From 2f45f419b133ec734ca8abecf8cc0bb9ea2cc30c Mon Sep 17 00:00:00 2001 From: Til Schmitter Date: Sat, 9 May 2026 12:20:23 +0200 Subject: [PATCH] init bbox later --- copyparty/web/baguettebox.js | 12 ++++++++++++ copyparty/web/browser.html | 4 ++-- copyparty/web/browser.js | 7 +++++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/copyparty/web/baguettebox.js b/copyparty/web/baguettebox.js index 34a05c64..7d6a417a 100644 --- a/copyparty/web/baguettebox.js +++ b/copyparty/web/baguettebox.js @@ -1374,4 +1374,16 @@ window.baguetteBox = (function () { }; })(); + +function init(){ + if(thegrid != undefined){ + thegrid.bagit(); + } + else{ + console.log('loop'); + setTimeout(init, 100) + } +} +init(); + J_BBX = 2; diff --git a/copyparty/web/browser.html b/copyparty/web/browser.html index 1b55c506..304d7468 100644 --- a/copyparty/web/browser.html +++ b/copyparty/web/browser.html @@ -272,8 +272,8 @@ {%- if lang != "eng" %} {%- endif %} - + {%- if js %} @@ -281,8 +281,8 @@ diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index d0507f21..6da535f7 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -6061,7 +6061,7 @@ var showfile = (function () { })(); -var thegrid = (function () { +window.thegrid = (function () { var lfiles = ebi('files'), gfiles = mknod('div', 'gfiles'); @@ -6511,7 +6511,7 @@ var thegrid = (function () { } r.dirty = false; - r.bagit('#ggrid'); + //r.bagit('#ggrid'); r.loadsel(); aligngriditems(); setTimeout(r.tippen, 20); @@ -6530,12 +6530,15 @@ var thegrid = (function () { } r.bagit = function (isrc) { + console.log('init image viewer'); if (!window.baguetteBox) return; if (r.bbox) baguetteBox.destroy(); + if(!isrc) + isrc = thegrid.en ? '#ggrid' : '#files' var br = baguetteBox.run(isrc, { noScrollbars: true, duringHide: r.onhide,