pinafore/routes/_store/observers/customScrollbarObservers.js
2018-11-27 19:17:18 -08:00

13 lines
409 B
JavaScript

let theScrollbarStyle = process.browser && document.getElementById('theScrollbarStyle')
export function customScrollbarObservers (store) {
store.observe('disableCustomScrollbars', disableCustomScrollbars => {
if (!process.browser) {
return
}
// disables or enables the style
theScrollbarStyle.setAttribute('media', disableCustomScrollbars ? 'only x' : 'all')
}, { init: false })
}