forked from cybrespace/pinafore
* perf: lazy-load logged-in observers, fix circular dependencies * I guess async deps don't count as circular deps
14 lines
438 B
JavaScript
14 lines
438 B
JavaScript
import { store } from '../store'
|
|
|
|
let theScrollbarStyle = process.browser && document.getElementById('theScrollbarStyle')
|
|
|
|
export function customScrollbarObservers () {
|
|
store.observe('disableCustomScrollbars', disableCustomScrollbars => {
|
|
if (!process.browser) {
|
|
return
|
|
}
|
|
|
|
// disables or enables the style
|
|
theScrollbarStyle.setAttribute('media', disableCustomScrollbars ? 'only x' : 'all')
|
|
}, { init: false })
|
|
}
|