Skip to content

Commit

Permalink
better error message when '.reveal' root node is missing hakimel#2217
Browse files Browse the repository at this point in the history
  • Loading branch information
hakimel authored and Fabian Wermelinger committed Oct 1, 2021
1 parent d4c93ba commit 7b62e81
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dist/reveal.esm.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/reveal.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions js/reveal.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ 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

0 comments on commit 7b62e81

Please sign in to comment.