diff --git a/docs/en/docs/js/custom.js b/docs/en/docs/js/custom.js index 4c0ada312e..425b7fce7f 100644 --- a/docs/en/docs/js/custom.js +++ b/docs/en/docs/js/custom.js @@ -135,10 +135,28 @@ async function showRandomAnnouncement(groupId, timeInterval) { } } +function hideSponsorOnImageError() { + const sponsorImages = document.querySelectorAll('.sponsor-image'); + const announceRight = document.getElementById('announce-right'); + + function hideAnnounceRight() { + if (announceRight) { + announceRight.style.display = 'none'; + } + } + + sponsorImages.forEach(function(img) { + img.addEventListener('error', function() { + hideAnnounceRight(); + }); + }); +} + async function main() { setupTermynal(); showRandomAnnouncement('announce-left', 5000) showRandomAnnouncement('announce-right', 10000) + hideSponsorOnImageError(); } document$.subscribe(() => { main()