aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2019-01-22 09:45:33 +0100
committerHakim El Hattab <hakim.elhattab@gmail.com>2019-01-22 09:45:33 +0100
commit5002304fb119859fe0d115883acceb094bc41be0 (patch)
tree33c3d62636730efb7cf97801d59f1b88fefb9baa /js
parentc36caef5e7f2a448df8503ff8eb37defea297152 (diff)
downloadperl-software-in-gnu-guix-5002304fb119859fe0d115883acceb094bc41be0.tar
perl-software-in-gnu-guix-5002304fb119859fe0d115883acceb094bc41be0.tar.gz
correct height of reveal.js on mobile devices, fixes vertical overflow
Diffstat (limited to 'js')
-rw-r--r--js/reveal.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/js/reveal.js b/js/reveal.js
index afd678b..88ce029 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -2065,6 +2065,16 @@
if( !config.disableLayout ) {
+ // On some mobile devices '100vh' is taller than the visible
+ // viewport which leads to part of the presentation being
+ // cut off. To work around this we define our own '--vh' custom
+ // property where 100x adds up to the correct height.
+ //
+ // https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
+ if( isMobileDevice ) {
+ document.documentElement.style.setProperty( '--vh', ( window.innerHeight * 0.01 ) + 'px' );
+ }
+
var size = getComputedSlideSize();
// Layout the contents of the slides