]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commit
fix: keep a scrollbar on document when Reveal opens #7831
authorNicolas Coden <nicolas@ncoden.fr>
Sun, 17 Jun 2018 21:52:41 +0000 (23:52 +0200)
committerNicolas Coden <nicolas@ncoden.fr>
Sun, 17 Jun 2018 21:52:41 +0000 (23:52 +0200)
commite6eb9b09190505b4d6f76655030b0b69902a8448
tree57255416bd1b1fd7844bc99824ef6f0ecdbd2560
parent06ec68c8a728c3b20d89bb1e2fd4429377a3a1b9
fix: keep a scrollbar on document when Reveal opens #7831

#11065 was intented to avoid double scrollbars from a Reveal modal, but removing all scrollbars when the modal opens changes the page content width and the content shift. This is a regression of #7831.

The current solution is a mix between the two previous fixes:
* Modal may have a scrollbar or not, following its content height
* Body has no scrollbar and prevent any scroll
* Document may have a scrollbar, following its content height (controlled in JS)

Changes:
* add the `zf-has-scroll` global html modifer and toggle it on Reveal opening/closing
* always prevent scroll on body instead of html tag like in #10583

See https://github.com/zurb/foundation-sites/issues/10791#issuecomment-377861523
Closes #7831
js/foundation.reveal.js
scss/components/_reveal.scss