1
0
mirror of https://github.com/hakimel/reveal.js.git synced 2025-10-29 12:46:34 +01:00

reader mode tests

This commit is contained in:
Hakim El Hattab
2023-10-06 09:52:21 +02:00
parent ab52d334df
commit d84aa3472e
8 changed files with 132 additions and 25 deletions

View File

@@ -249,24 +249,18 @@ export default function( revealElement, options ) {
// Avoid content flickering during layout
dom.viewport.classList.add( 'loading-scroll-mode' );
const activate = () => {
if( activatePrintView ) {
if( activatePrintView ) {
// The document needs to have loaded for the PDF layout
// measurements to be accurate
if( document.readyState === 'complete' ) {
print.activate();
}
else {
reader.activate();
window.addEventListener( 'load', () => print.activate() );
}
};
// The document needs to have loaded for the PDF layout
// measurements to be accurate
if( document.readyState === 'complete' ) {
activate();
}
else {
window.addEventListener( 'load', () => {
activate();
} );
reader.activate();
}
}
@@ -2784,7 +2778,7 @@ export default function( revealElement, options ) {
toggleOverview: overview.toggle.bind( overview ),
// Toggles the reader mode on/off
toggleReader: reader.toggle.bind( reader ),
toggleReaderMode: reader.toggle.bind( reader ),
// Toggles the "black screen" mode on/off
togglePause,