fix bbox after load rework

This commit is contained in:
Til Schmitter 2026-05-09 15:09:39 +02:00
parent ce4e70308a
commit 3a22949c8b
2 changed files with 8 additions and 6 deletions

View file

@ -1376,14 +1376,16 @@ window.baguetteBox = (function () {
function init(){
if(thegrid != undefined && thegrid.dirty == false){
if(thegrid != undefined && thegrid.dirty == false && thegrid.bbox != true){
console.log('bbox load')
thegrid.bagit();
}
else{
console.log('wait for grid init');
setTimeout(init, 100)
}
}
console.log('wait for grid init');
init();
J_BBX = 2;

View file

@ -4101,6 +4101,7 @@ function eval_hash() {
var media = scan_hash(v);
if (media) {
console.log('got media in hash')
var mtype = media[0],
id = media[1],
ts = media[2];
@ -6514,7 +6515,7 @@ window.thegrid = (function () {
r.dirty = false;
r.loadsel();
if(window.baguetteBox != undefined)
r.bagit('#ggrid');
r.bagit();
setTimeout(aligngriditems, 1);
setTimeout(r.tippen, 20);
drag.initgrid();
@ -6533,9 +6534,7 @@ window.thegrid = (function () {
r.bagit = function (isrc) {
console.log('init image viewer');
if (!window.baguetteBox)
return;
if (r.bbox)
baguetteBox.destroy();
@ -6563,6 +6562,7 @@ window.thegrid = (function () {
});
r.bbox_opts = br[1];
r.bbox = true;
eval_hash()
};
r.onhide = function () {