diff --git a/src/email-recovery.js b/src/email-recovery.js index e28a1c97a7cd334920dfe86dc179507212fb4136..f5c80e148e899bbe77fec89bbca17eb40d8fbc73 100644 --- a/src/email-recovery.js +++ b/src/email-recovery.js @@ -16,14 +16,21 @@ document.addEventListener('DOMContentLoaded', function() { newDiv.appendChild(contentDiv) newDiv.appendChild(link) insertIntoDOM(newDiv) - // Measure the height after the element is inserted into the DOM + const banner = document.getElementById('recovery-email-banner') - if (banner) { + const content = document.getElementById('content') + const contentVue = document.getElementById('content-vue') + // Measure the height after the element is inserted into the DOM + if (banner && (content || contentVue)) { const bannerHeight = banner.clientHeight + 'px' const topHeight = (banner.clientHeight + 50) + 'px' setTopStyle('#header', bannerHeight) - setMarginTopAndHeight('#content', topHeight) - setMarginTopAndHeight('#content-vue', topHeight) + if (content) { + setMarginTopAndHeight('#content', topHeight) + } + if (contentVue) { + setMarginTopAndHeight('#content-vue', topHeight) + } setTopStyleWhenElementAvailable('#header-menu-user-menu', topHeight) setTopStyleWhenElementAvailable('#header-menu-notifications', topHeight) setTopStyle('#header-menu-unified-search', topHeight)