1
0
Fork 0

check for slides container too #2217

This commit is contained in:
Hakim El Hattab 2021-08-27 09:48:53 +02:00
parent e237fea99a
commit 01d8d669bc
3 changed files with 6 additions and 7 deletions

2
dist/reveal.esm.js vendored

File diff suppressed because one or more lines are too long

2
dist/reveal.js vendored

File diff suppressed because one or more lines are too long

View File

@ -44,11 +44,6 @@ export default function( revealElement, options ) {
revealElement = document.querySelector( '.reveal' ); 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 = {}; const Reveal = {};
// Configuration defaults, can be overridden at initialization time // Configuration defaults, can be overridden at initialization time
@ -126,10 +121,14 @@ export default function( revealElement, options ) {
*/ */
function initialize( initOptions ) { function initialize( initOptions ) {
if( !revealElement ) throw 'Unable to find presentation root (<div class="reveal">).';
// Cache references to key DOM elements // Cache references to key DOM elements
dom.wrapper = revealElement; dom.wrapper = revealElement;
dom.slides = revealElement.querySelector( '.slides' ); 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: // Compose our config object in order of increasing precedence:
// 1. Default reveal.js options // 1. Default reveal.js options
// 2. Options provided via Reveal.configure() prior to // 2. Options provided via Reveal.configure() prior to