mirror of
https://github.com/hakimel/reveal.js.git
synced 2025-08-06 14:47:04 +02:00
fix missing backgrounds when scroll view is actived responsively (fixes #3554)
This commit is contained in:
2
dist/reveal.esm.js
vendored
2
dist/reveal.esm.js
vendored
File diff suppressed because one or more lines are too long
2
dist/reveal.esm.js.map
vendored
2
dist/reveal.esm.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/reveal.js
vendored
2
dist/reveal.js
vendored
File diff suppressed because one or more lines are too long
2
dist/reveal.js.map
vendored
2
dist/reveal.js.map
vendored
File diff suppressed because one or more lines are too long
49
js/reveal.js
49
js/reveal.js
@@ -1016,19 +1016,9 @@ export default function( revealElement, options ) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Responsively turn on the scroll mode if there is an activation
|
checkResponsiveScrollView();
|
||||||
// width configured. Ignore if we're configured to always be in
|
|
||||||
// scroll mode.
|
|
||||||
if( typeof config.scrollActivationWidth === 'number' && config.view !== 'scroll' ) {
|
|
||||||
if( size.presentationWidth > 0 && size.presentationWidth <= config.scrollActivationWidth ) {
|
|
||||||
if( !scrollView.isActive() ) scrollView.activate();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if( scrollView.isActive() ) scrollView.deactivate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dom.viewport.style.setProperty( '--slide-scale', scale );
|
dom.viewport.style.setProperty( '--slide-scale', scale );
|
||||||
dom.viewport.style.setProperty( '--viewport-width', viewportWidth + 'px' );
|
dom.viewport.style.setProperty( '--viewport-width', viewportWidth + 'px' );
|
||||||
@@ -1081,6 +1071,40 @@ export default function( revealElement, options ) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Responsively activates the scroll mode when we reach the configured
|
||||||
|
* activation width.
|
||||||
|
*/
|
||||||
|
function checkResponsiveScrollView() {
|
||||||
|
|
||||||
|
// Only proceed if...
|
||||||
|
// 1. The DOM is ready
|
||||||
|
// 2. Layouts aren't disabled via config
|
||||||
|
// 3. We're not currently printing
|
||||||
|
// 4. There is a scrollActivationWidth set
|
||||||
|
// 5. The deck isn't configured to always use the scroll view
|
||||||
|
if(
|
||||||
|
dom.wrapper &&
|
||||||
|
!config.disableLayout &&
|
||||||
|
!printView.isActive() &&
|
||||||
|
typeof config.scrollActivationWidth === 'number' &&
|
||||||
|
config.view !== 'scroll'
|
||||||
|
) {
|
||||||
|
const size = getComputedSlideSize();
|
||||||
|
|
||||||
|
if( size.presentationWidth > 0 && size.presentationWidth <= config.scrollActivationWidth ) {
|
||||||
|
if( !scrollView.isActive() ) {
|
||||||
|
backgrounds.create();
|
||||||
|
scrollView.activate()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if( scrollView.isActive() ) scrollView.deactivate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculates the computed pixel size of our slides. These
|
* Calculates the computed pixel size of our slides. These
|
||||||
* values are based on the width and height configuration
|
* values are based on the width and height configuration
|
||||||
@@ -2700,7 +2724,6 @@ export default function( revealElement, options ) {
|
|||||||
function onWindowResize( event ) {
|
function onWindowResize( event ) {
|
||||||
|
|
||||||
layout();
|
layout();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "reveal.js",
|
"name": "reveal.js",
|
||||||
"version": "5.0.3",
|
"version": "5.0.4",
|
||||||
"description": "The HTML Presentation Framework",
|
"description": "The HTML Presentation Framework",
|
||||||
"homepage": "https://revealjs.com",
|
"homepage": "https://revealjs.com",
|
||||||
"subdomain": "revealjs",
|
"subdomain": "revealjs",
|
||||||
|
Reference in New Issue
Block a user