biome format --write
This commit is contained in:
parent
8372348148
commit
9262e803ec
415 changed files with 54076 additions and 17419 deletions
|
|
@ -7,7 +7,7 @@ const lockerEls = new Set([])
|
|||
const disableBodyScroll = (el) => {
|
||||
const scrollBarGap = window.innerWidth - document.documentElement.clientWidth
|
||||
bodyScrollLock.disableBodyScroll(el, {
|
||||
reserveScrollBarGap: true
|
||||
reserveScrollBarGap: true,
|
||||
})
|
||||
lockerEls.add(el)
|
||||
setTimeout(() => {
|
||||
|
|
@ -15,14 +15,22 @@ const disableBodyScroll = (el) => {
|
|||
// If previousNavPaddingRight is already set, don't set it again.
|
||||
if (previousNavPaddingRight === undefined) {
|
||||
const navEl = document.getElementById('nav')
|
||||
previousNavPaddingRight = window.getComputedStyle(navEl).getPropertyValue('padding-right')
|
||||
navEl.style.paddingRight = previousNavPaddingRight ? `calc(${previousNavPaddingRight} + ${scrollBarGap}px)` : `${scrollBarGap}px`
|
||||
previousNavPaddingRight = window
|
||||
.getComputedStyle(navEl)
|
||||
.getPropertyValue('padding-right')
|
||||
navEl.style.paddingRight = previousNavPaddingRight
|
||||
? `calc(${previousNavPaddingRight} + ${scrollBarGap}px)`
|
||||
: `${scrollBarGap}px`
|
||||
}
|
||||
// If previousAppBgWrapeprRight is already set, don't set it again.
|
||||
if (previousAppBgWrapperRight === undefined) {
|
||||
const appBgWrapperEl = document.getElementById('app_bg_wrapper')
|
||||
previousAppBgWrapperRight = window.getComputedStyle(appBgWrapperEl).getPropertyValue('right')
|
||||
appBgWrapperEl.style.right = previousAppBgWrapperRight ? `calc(${previousAppBgWrapperRight} + ${scrollBarGap}px)` : `${scrollBarGap}px`
|
||||
previousAppBgWrapperRight = window
|
||||
.getComputedStyle(appBgWrapperEl)
|
||||
.getPropertyValue('right')
|
||||
appBgWrapperEl.style.right = previousAppBgWrapperRight
|
||||
? `calc(${previousAppBgWrapperRight} + ${scrollBarGap}px)`
|
||||
: `${scrollBarGap}px`
|
||||
}
|
||||
document.body.classList.add('scroll-locked')
|
||||
}
|
||||
|
|
@ -34,12 +42,14 @@ const enableBodyScroll = (el) => {
|
|||
setTimeout(() => {
|
||||
if (lockerEls.size === 0) {
|
||||
if (previousNavPaddingRight !== undefined) {
|
||||
document.getElementById('nav').style.paddingRight = previousNavPaddingRight
|
||||
document.getElementById('nav').style.paddingRight =
|
||||
previousNavPaddingRight
|
||||
// Restore previousNavPaddingRight to undefined so disableBodyScroll knows it can be set again.
|
||||
previousNavPaddingRight = undefined
|
||||
}
|
||||
if (previousAppBgWrapperRight !== undefined) {
|
||||
document.getElementById('app_bg_wrapper').style.right = previousAppBgWrapperRight
|
||||
document.getElementById('app_bg_wrapper').style.right =
|
||||
previousAppBgWrapperRight
|
||||
// Restore previousAppBgWrapperRight to undefined so disableBodyScroll knows it can be set again.
|
||||
previousAppBgWrapperRight = undefined
|
||||
}
|
||||
|
|
@ -68,7 +78,7 @@ const directive = {
|
|||
},
|
||||
unmounted: (el) => {
|
||||
enableBodyScroll(el)
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
export default (Vue) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue