diff options
author | pluralcafe-docker <git@plural.cafe> | 2019-01-21 04:35:29 +0000 |
---|---|---|
committer | pluralcafe-docker <git@plural.cafe> | 2019-01-21 04:35:29 +0000 |
commit | b7c67605d5c2110b4a3cd3d8a7b8ef2878cbfe48 (patch) | |
tree | a3344b6105b7771983f69c789fb2f7a0c22a8583 /app/javascript/flavours/glitch/packs | |
parent | fb7ec403227690f897a9a693f2461b94bf7e2582 (diff) | |
parent | aa362ab73dc7121104b3c01800152b9fc56ea396 (diff) |
Merge branch 'glitch'
Diffstat (limited to 'app/javascript/flavours/glitch/packs')
-rw-r--r-- | app/javascript/flavours/glitch/packs/public.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/packs/public.js b/app/javascript/flavours/glitch/packs/public.js index 56012ba78..da0b4c8e0 100644 --- a/app/javascript/flavours/glitch/packs/public.js +++ b/app/javascript/flavours/glitch/packs/public.js @@ -86,6 +86,14 @@ function main() { if (parallaxComponents.length > 0 ) { new Rellax('.parallax', { speed: -1 }); } + + if (document.body.classList.contains('with-modals')) { + const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth; + const scrollbarWidthStyle = document.createElement('style'); + scrollbarWidthStyle.id = 'scrollbar-width'; + document.head.appendChild(scrollbarWidthStyle); + scrollbarWidthStyle.sheet.insertRule(`body.with-modals--active { margin-right: ${scrollbarWidth}px; }`, 0); + } }); } |