fixed bug

This commit is contained in:
Vaica committed 2026-01-31 21:27:06 +08:00
1 parent 54b18039e3
commit 8c3232fadf
16 files changed
+1134 -97

No files matched your search

+20 -10
View File
@@ -33,7 +33,7 @@ window.initArtalk = function() {
<div class="atk-main" uk-scrollspy="cls: uk-animation-slide-right-small; delay: 300">
<div class="atk-header">
<span class="atk-nick" uk-scrollspy="cls: uk-animation-slide-top-small; delay: 350">${ai.name}</span>
<span class="atk-badge">AI</span>
<span class="atk-badge">${window.artalkConfig.aiBadge || 'AI'}</span>
<span class="atk-date">${ai.date}</span>
</div>
<div class="atk-body">
@@ -71,20 +71,30 @@ window.initArtalk = function() {
});
// Find all avatars in the comment list
var avatars = document.querySelectorAll('.atk-list .atk-avatar img');
avatars.forEach(function(img) {
var src = img.getAttribute('src');
if (src) {
img.setAttribute('data-lazy-src', src);
img.removeAttribute('src');
img.classList.add('lazyload');
}
});
// We let lazyload.js handle the avatars automatically by calling lazyLoadAgain()
// which will find these new images, set the placeholder, and observe them.
// Trigger lazy load update
if (window.lazyLoadAgain) {
window.lazyLoadAgain();
}
// Force hide "No Comment" if AI comment exists
if (window.artalkConfig.aiComment) {
var checkNoComment = setInterval(function() {
var noComment = document.querySelector('.atk-list-no-comment');
var aiComment = document.querySelector('.atk-ai-comment');
if (aiComment && noComment && noComment.style.display !== 'none') {
noComment.style.display = 'none';
}
if (!document.querySelector('#Comments')) {
clearInterval(checkNoComment);
}
}, 500);
// Clear interval after 10 seconds to save resources
setTimeout(function() { clearInterval(checkNoComment); }, 10000);
}
});
} catch (e) {