mirror of
https://github.com/Noratrieb/slides.git
synced 2026-01-16 09:25:06 +01:00
add support for responsively activating reader mode via
This commit is contained in:
parent
899a45dff6
commit
ab52d334df
8 changed files with 146 additions and 6 deletions
12
js/reveal.js
12
js/reveal.js
|
|
@ -999,6 +999,18 @@ export default function( revealElement, options ) {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Responsively turn on the reader mode if there is an activation
|
||||
// width configured. Ignore if we're configured to always be in
|
||||
// reader mode.
|
||||
if( typeof config.readerActivationWidth === 'number' && config.view !== 'reader' ) {
|
||||
if( size.presentationWidth < config.readerActivationWidth ) {
|
||||
if( !reader.isActive() ) reader.activate();
|
||||
}
|
||||
else {
|
||||
if( reader.isActive() ) reader.deactivate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dom.viewport.style.setProperty( '--slide-scale', scale );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue