2018-12-16 10:22:34 -08:00
|
|
|
import { store } from '../store'
|
|
|
|
|
2018-11-27 19:17:18 -08:00
|
|
|
let theScrollbarStyle = process.browser && document.getElementById('theScrollbarStyle')
|
|
|
|
|
2018-12-16 10:22:34 -08:00
|
|
|
export function customScrollbarObservers () {
|
2018-11-27 19:17:18 -08:00
|
|
|
store.observe('disableCustomScrollbars', disableCustomScrollbars => {
|
|
|
|
if (!process.browser) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// disables or enables the style
|
|
|
|
theScrollbarStyle.setAttribute('media', disableCustomScrollbars ? 'only x' : 'all')
|
|
|
|
}, { init: false })
|
|
|
|
}
|