mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Change: only attempt to style .main-navigation, if it exists
This commit is contained in:
parent
f3a7c10e8a
commit
f3d2d35b26
@ -48,16 +48,23 @@ export default {
|
|||||||
if (isOpen) {
|
if (isOpen) {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const paddingRightStyle = `${window.innerWidth - document.documentElement.clientWidth}px`
|
const paddingRightStyle = `${window.innerWidth -
|
||||||
|
document.documentElement.clientWidth}px`
|
||||||
|
const navigationElement = document.querySelector('.main-navigation')
|
||||||
document.body.style.paddingRight = paddingRightStyle
|
document.body.style.paddingRight = paddingRightStyle
|
||||||
document.querySelector('.main-navigation').style.paddingRight = paddingRightStyle
|
|
||||||
document.body.classList.add('dropdown-open')
|
document.body.classList.add('dropdown-open')
|
||||||
|
if (navigationElement) {
|
||||||
|
navigationElement.style.paddingRight = paddingRightStyle
|
||||||
|
}
|
||||||
}, 20)
|
}, 20)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
const navigationElement = document.querySelector('.main-navigation')
|
||||||
document.body.style.paddingRight = null
|
document.body.style.paddingRight = null
|
||||||
document.querySelector('.main-navigation').style.paddingRight = null
|
|
||||||
document.body.classList.remove('dropdown-open')
|
document.body.classList.remove('dropdown-open')
|
||||||
|
if (navigationElement) {
|
||||||
|
navigationElement.style.paddingRight = null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (err) {}
|
} catch (err) {}
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user