don't style html element if reveal.js is embedded
This commit is contained in:
parent
3a7f210631
commit
f24620018f
|
@ -11,7 +11,7 @@
|
||||||
* GLOBAL STYLES
|
* GLOBAL STYLES
|
||||||
*********************************************/
|
*********************************************/
|
||||||
|
|
||||||
html {
|
html.reveal-full-page {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
26
js/reveal.js
26
js/reveal.js
|
@ -137,14 +137,25 @@ export default function( revealElement, options ) {
|
||||||
dom.wrapper = revealElement;
|
dom.wrapper = revealElement;
|
||||||
dom.slides = revealElement.querySelector( '.slides' );
|
dom.slides = revealElement.querySelector( '.slides' );
|
||||||
|
|
||||||
// Force a layout when the whole page, incl fonts, has loaded
|
|
||||||
window.addEventListener( 'load', layout, false );
|
|
||||||
|
|
||||||
// Copy options over to our config object
|
// Copy options over to our config object
|
||||||
config = { ...defaultConfig, ...options, ...getQueryHash() };
|
config = { ...defaultConfig, ...options, ...getQueryHash() };
|
||||||
|
|
||||||
|
// Embedded decks use the reveal element as their viewport
|
||||||
|
if( config.embedded === true ) {
|
||||||
|
revealElement.classList.add( 'reveal-viewport' );
|
||||||
|
}
|
||||||
|
// Non-embedded decks cover the full page and use the body
|
||||||
|
// as their viewport
|
||||||
|
else {
|
||||||
|
document.body.classList.add( 'reveal-viewport' );
|
||||||
|
document.documentElement.classList.add( 'reveal-full-page' );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Force a layout when the whole page, incl fonts, has loaded
|
||||||
|
window.addEventListener( 'load', layout, false );
|
||||||
|
|
||||||
// Load plugins then move on to #start()
|
// Load plugins then move on to #start()
|
||||||
plugins.load( config.dependencies ).then( start )
|
plugins.load( config.dependencies ).then( start );
|
||||||
|
|
||||||
return new Promise( resolve => Reveal.addEventListener( 'ready', resolve ) );
|
return new Promise( resolve => Reveal.addEventListener( 'ready', resolve ) );
|
||||||
|
|
||||||
|
@ -230,13 +241,6 @@ export default function( revealElement, options ) {
|
||||||
dom.wrapper.classList.remove( 'no-hover' );
|
dom.wrapper.classList.remove( 'no-hover' );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( config.embedded === true ) {
|
|
||||||
revealElement.classList.add( 'reveal-viewport' );
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
document.body.classList.add( 'reveal-viewport' );
|
|
||||||
}
|
|
||||||
|
|
||||||
backgrounds.render();
|
backgrounds.render();
|
||||||
slideNumber.render();
|
slideNumber.render();
|
||||||
controls.render();
|
controls.render();
|
||||||
|
|
Loading…
Reference in New Issue