1
0
mirror of https://github.com/hakimel/reveal.js.git synced 2025-08-19 13:02:22 +02:00

reader mode -> scroll view, auto-enable below 435px width

This commit is contained in:
Hakim El Hattab
2023-10-25 13:58:06 +02:00
parent e46bad392a
commit c23964274c
16 changed files with 154 additions and 149 deletions

View File

@@ -4,7 +4,7 @@
<head>
<meta charset="utf-8">
<title>reveal.js - Test Reader Mode</title>
<title>reveal.js - Test Scroll View</title>
<link rel="stylesheet" href="../dist/reveal.css">
<link rel="stylesheet" href="../node_modules/qunit/qunit/qunit.css">
@@ -57,18 +57,18 @@
return Reveal.getViewportElement().offsetHeight;
}
Reveal.initialize({ view: 'reader' }).then( async () => {
Reveal.initialize({ view: 'scroll' }).then( async () => {
QUnit.module( 'Reader Mode' );
QUnit.module( 'Scroll View' );
QUnit.test( 'Activates', assert => {
assert.ok( getScrollHeight() > getViewportHeight(), 'Is overflowing' );
});
QUnit.test( 'Can be toggled via API', assert => {
Reveal.toggleReaderMode( false );
Reveal.toggleScrollView( false );
assert.ok( getScrollHeight() <= getViewportHeight(), 'Is not overflowing' );
Reveal.toggleReaderMode( true );
Reveal.toggleScrollView( true );
assert.ok( getScrollHeight() > getViewportHeight(), 'Is overflowing' );
});