kopia lustrzana https://github.com/nolanlawson/pinafore
15 wiersze
500 B
JavaScript
15 wiersze
500 B
JavaScript
import { store } from '../store.js'
|
|
|
|
const 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 }) // init:false because the inline script takes care of it
|
|
}
|