better error message when '.reveal' root node is missing #2217

This commit is contained in:
Hakim El Hattab 2021-08-27 09:40:33 +02:00
parent b18f12d964
commit e237fea99a
3 changed files with 9 additions and 4 deletions

4
dist/reveal.esm.js vendored

File diff suppressed because one or more lines are too long

4
dist/reveal.js vendored

File diff suppressed because one or more lines are too long

View File

@ -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