mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Fix: content shift when y-scrollbar disappears
This commit is contained in:
parent
0185951834
commit
f3a7c10e8a
@ -48,11 +48,16 @@ export default {
|
|||||||
if (isOpen) {
|
if (isOpen) {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
document.getElementsByTagName('body')[0].classList.add('dropdown-open')
|
const paddingRightStyle = `${window.innerWidth - document.documentElement.clientWidth}px`
|
||||||
|
document.body.style.paddingRight = paddingRightStyle
|
||||||
|
document.querySelector('.main-navigation').style.paddingRight = paddingRightStyle
|
||||||
|
document.body.classList.add('dropdown-open')
|
||||||
}, 20)
|
}, 20)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
document.getElementsByTagName('body')[0].classList.remove('dropdown-open')
|
document.body.style.paddingRight = null
|
||||||
|
document.querySelector('.main-navigation').style.paddingRight = null
|
||||||
|
document.body.classList.remove('dropdown-open')
|
||||||
}
|
}
|
||||||
} catch (err) {}
|
} catch (err) {}
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user