fix(Header): fixed height for header image to not cause css glitch at startup

This commit is contained in:
Matthieu Bessat 2020-09-05 23:31:26 +02:00
parent fb7aa315b4
commit 5bd5a5f0df
4 changed files with 8 additions and 9 deletions

View file

@ -220,7 +220,7 @@ function renderCard(organization) {
let currentTag = null
let currentCardContainer = null
function enableTag(node, sortOperation = false) {
function enableTag(node, sortOperation = false, initialOperation = false) {
let all = node.id === 'nav-all'
let tagId = ''
@ -250,12 +250,12 @@ function enableTag(node, sortOperation = false) {
}
// close the menu if on mobile
if (navEnablerExists) {
if (navEnablerExists && !initialOperation) {
navOpened = !navOpened
closeMenu()
document.getElementsByClassName('content')[0].scrollIntoView(true)
} else {
if (window.scrollY() > 300) {
if (window.scrollY() > 300 && !initialOperation) {
document.getElementsByClassName('content')[0].scrollIntoView(true)
}
}
@ -368,5 +368,5 @@ window.addEventListener('DOMContentLoaded', () => {
iconHTML: node.querySelector('.nav-icon').innerHTML
})
})
enableTag(navAll)
enableTag(navAll, false, true)
})