pinafore/routes/_store/observers/customScrollbarObservers.js

13 lines
409 B
JavaScript
Raw Normal View History

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 })
}