fixed 修复图片灯箱bug

This commit is contained in:
Vaica committed 2026-03-01 10:16:28 +08:00
1 parent 7f379dafd8
commit df4ef82e4e
2 files changed
+35 -2

No files matched your search

@@ -190,6 +190,26 @@ window.initFloatingTools = function() {
}
});
}
// 4. Lightbox Observer (ViewImage)
// Hide floating tools when lightbox is open
if (window.lightboxObserver) {
window.lightboxObserver.disconnect();
}
if (container) {
window.lightboxObserver = new MutationObserver(function(mutations) {
var lightbox = document.querySelector('.view-image');
if (lightbox) {
container.classList.add('hidden');
} else {
container.classList.remove('hidden');
}
});
window.lightboxObserver.observe(document.body, { childList: true });
}
} catch (e) {
console.error('Error in initFloatingTools:', e);
}