From: Hakim El Hattab Date: Sat, 21 Jul 2012 02:09:56 +0000 (-0400) Subject: null check progress DOM element even if it's configured to be on X-Git-Tag: 1.4.0~2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7f9662edab1c7d25c3a74506e365684e0befb7c3;p=reveal.js.git null check progress DOM element even if it's configured to be on --- diff --git a/README.md b/README.md index acc4147..298c1cf 100644 --- a/README.md +++ b/README.md @@ -176,6 +176,7 @@ You can change the appearance of the speaker notes by editing the file at `plugi - Added beige theme - Added 'autoSlide' config - Bug fix: The 'slidechanged' event is now firing upon 'hashchange'. Thanks [basecode](https://github.com/basecode) +- Bug fix: JS error when the 'progress' option was true but there was no progress DOM element #### 1.3 - Revised keyboard shortcuts, including ESC for overview, N for next, P for previous. Thanks [mahemoff](https://github.com/mahemoff) diff --git a/js/reveal.js b/js/reveal.js index c9e69a8..e0be839 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -155,7 +155,7 @@ var Reveal = (function(){ dom.controls.style.display = 'block'; } - if( config.progress ) { + if( config.progress && dom.progress ) { dom.progress.style.display = 'block'; } @@ -680,7 +680,7 @@ var Reveal = (function(){ } // Update progress if enabled - if( config.progress ) { + if( config.progress && dom.progress ) { dom.progressbar.style.width = ( indexh / ( document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ).length - 1 ) ) * window.innerWidth + 'px'; }