diff --git a/copyparty/web/baguettebox.js b/copyparty/web/baguettebox.js index e4126992..b1f12792 100644 --- a/copyparty/web/baguettebox.js +++ b/copyparty/web/baguettebox.js @@ -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; diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index f15d9b54..680b089b 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -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 () {