Browse Source

don't style html element if reveal.js is embedded

master
Hakim El Hattab 2 years ago
parent
commit
f24620018f
  1. 2
      css/reveal.scss
  2. 2
      dist/reveal.css
  3. 2
      dist/reveal.min.js
  4. 26
      js/reveal.js

2
css/reveal.scss

@ -11,7 +11,7 @@
* GLOBAL STYLES
*********************************************/
html {
html.reveal-full-page {
width: 100%;
height: 100%;
height: 100vh;

2
dist/reveal.css

File diff suppressed because one or more lines are too long

2
dist/reveal.min.js

File diff suppressed because one or more lines are too long

26
js/reveal.js

@ -137,14 +137,25 @@ export default function( revealElement, options ) {
dom.wrapper = revealElement;
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
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()
plugins.load( config.dependencies ).then( start )
plugins.load( config.dependencies ).then( start );
return new Promise( resolve => Reveal.addEventListener( 'ready', resolve ) );
@ -230,13 +241,6 @@ export default function( revealElement, options ) {
dom.wrapper.classList.remove( 'no-hover' );
}
if( config.embedded === true ) {
revealElement.classList.add( 'reveal-viewport' );
}
else {
document.body.classList.add( 'reveal-viewport' );
}
backgrounds.render();
slideNumber.render();
controls.render();

Loading…
Cancel
Save