优化一下博客的性能
This commit is contained in:
1 parent
15421ff0ac
commit
427b17d7a0
24 files changed
+2045
-148
No files matched your search
@@ -198,16 +198,21 @@ window.initFloatingTools = function() {
|
||||
}
|
||||
|
||||
if (container) {
|
||||
window.lightboxObserver = new MutationObserver(function(mutations) {
|
||||
var syncLightboxState = function() {
|
||||
var lightbox = document.querySelector('.view-image');
|
||||
if (lightbox) {
|
||||
container.classList.add('hidden');
|
||||
} else {
|
||||
container.classList.remove('hidden');
|
||||
}
|
||||
};
|
||||
|
||||
window.lightboxObserver = new MutationObserver(function() {
|
||||
syncLightboxState();
|
||||
});
|
||||
|
||||
window.lightboxObserver.observe(document.body, { childList: true });
|
||||
window.lightboxObserver.observe(document.body, { childList: true, subtree: true });
|
||||
syncLightboxState();
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
|
||||
Reference in new issue
Block a user