fixed 修复图片灯箱bug
This commit is contained in:
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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user