Skip to content

Commit

Permalink
check for slides container too #2217
Browse files Browse the repository at this point in the history
  • Loading branch information
hakimel committed Aug 27, 2021
1 parent e237fea commit 01d8d66
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dist/reveal.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/reveal.js

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions js/reveal.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ export default function( revealElement, options ) {
revealElement = document.querySelector( '.reveal' );
}

// reveal.js can not be initialized without a root element
if( !revealElement ) {
throw 'Invalid or missing <div class="reveal"> element';
}

const Reveal = {};

// Configuration defaults, can be overridden at initialization time
Expand Down Expand Up @@ -126,10 +121,14 @@ export default function( revealElement, options ) {
*/
function initialize( initOptions ) {

if( !revealElement ) throw 'Unable to find presentation root (<div class="reveal">).';

// Cache references to key DOM elements
dom.wrapper = revealElement;
dom.slides = revealElement.querySelector( '.slides' );

if( !dom.slides ) throw 'Unable to find slides container (<div class="slides">).';

// Compose our config object in order of increasing precedence:
// 1. Default reveal.js options
// 2. Options provided via Reveal.configure() prior to
Expand Down

0 comments on commit 01d8d66

Please sign in to comment.