Calculate width of scrollbar for use with 100vw issues
getScrollBarWidth () {
const $body = $('body');
const windowWidth = window.innerWidth;
if ($body.prop('scrollHeight') > window.innerHeight) {
// Magic number to stop Chrome doing stupid stuff with sub-pixel widths
return windowWidth - $body.width() + 1;
}
return 0;
},