fix href image view not preventing default when init order wrong

This commit is contained in:
Til Schmitter 2026-05-09 13:10:33 +02:00
parent 43c23d75fd
commit 7bb7f30961
2 changed files with 16 additions and 7 deletions

View file

@ -1380,7 +1380,7 @@ function init(){
thegrid.bagit(); thegrid.bagit();
} }
else{ else{
console.log('loop'); console.log('wait for grid init');
setTimeout(init, 100) setTimeout(init, 100)
} }
} }

View file

@ -6295,8 +6295,11 @@ window.thegrid = (function () {
window.open(qhref, '_blank'); window.open(qhref, '_blank');
else { else {
if (!dbl) if (!dbl){
if(r.bbox && e.preventDefault)
e.preventDefault();
return true; return true;
}
setTimeout(function () { setTimeout(function () {
r.sel = true; r.sel = true;
@ -6511,7 +6514,6 @@ window.thegrid = (function () {
} }
r.dirty = false; r.dirty = false;
//r.bagit('#ggrid');
r.loadsel(); r.loadsel();
aligngriditems(); aligngriditems();
setTimeout(r.tippen, 20); setTimeout(r.tippen, 20);
@ -6539,6 +6541,7 @@ window.thegrid = (function () {
if(!isrc) if(!isrc)
isrc = thegrid.en ? '#ggrid' : '#files' isrc = thegrid.en ? '#ggrid' : '#files'
var br = baguetteBox.run(isrc, { var br = baguetteBox.run(isrc, {
noScrollbars: true, noScrollbars: true,
duringHide: r.onhide, duringHide: r.onhide,
@ -6558,8 +6561,8 @@ window.thegrid = (function () {
} }
} }
}); });
r.bbox = true;
r.bbox_opts = br[1]; r.bbox_opts = br[1];
r.bbox = true;
}; };
r.onhide = function () { r.onhide = function () {
@ -10986,9 +10989,15 @@ function reload_browser() {
} }
function sel_start(e) { function sel_start(e) {
if (e.button !== 0 && e.type !== 'touchstart') return; try{
if (!thegrid.en || !treectl.dsel) return; if (e.button !== 0 && e.type !== 'touchstart') return;
if (e.target.closest('#widget,#ops,.opview,.doc,#ggrid>a')) return; if (!thegrid.en || !treectl.dsel) return;
if (e.target.closest('#widget,#ops,.opview,.doc,#ggrid>a')) return;
}
catch(ex){
console.log(ex);
return;
}
if (e.target.closest('#gfiles')) if (e.target.closest('#gfiles'))
ebi('gfiles').style.userSelect = "none" ebi('gfiles').style.userSelect = "none"