fix grid toolbar undocking after viewing a pic/vid

This commit is contained in:
ed 2024-07-22 23:09:25 +00:00
parent ef0ecf878b
commit dc449bf8b0

View file

@ -29,6 +29,7 @@ window.baguetteBox = (function () {
isOverlayVisible = false, isOverlayVisible = false,
touch = {}, // start-pos touch = {}, // start-pos
touchFlag = false, // busy touchFlag = false, // busy
scrollCSS = ['', ''],
scrollTimer = 0, scrollTimer = 0,
re_i = /^[^?]+\.(a?png|avif|bmp|gif|heif|jpe?g|jfif|svg|webp)(\?|$)/i, re_i = /^[^?]+\.(a?png|avif|bmp|gif|heif|jpe?g|jfif|svg|webp)(\?|$)/i,
re_v = /^[^?]+\.(webm|mkv|mp4)(\?|$)/i, re_v = /^[^?]+\.(webm|mkv|mp4)(\?|$)/i,
@ -567,6 +568,12 @@ window.baguetteBox = (function () {
function showOverlay(chosenImageIndex) { function showOverlay(chosenImageIndex) {
if (options.noScrollbars) { if (options.noScrollbars) {
var a = document.documentElement.style.overflowY,
b = document.body.style.overflowY;
if (a != 'hidden' || b != 'scroll')
scrollCSS = [a, b];
document.documentElement.style.overflowY = 'hidden'; document.documentElement.style.overflowY = 'hidden';
document.body.style.overflowY = 'scroll'; document.body.style.overflowY = 'scroll';
} }
@ -615,8 +622,8 @@ window.baguetteBox = (function () {
playvid(false); playvid(false);
removeFromCache('#files'); removeFromCache('#files');
if (options.noScrollbars) { if (options.noScrollbars) {
document.documentElement.style.overflowY = 'auto'; document.documentElement.style.overflowY = scrollCSS[0];
document.body.style.overflowY = 'auto'; document.body.style.overflowY = scrollCSS[1];
} }
try { try {