aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2014-05-07 21:47:47 +0200
committerHakim El Hattab <hakim.elhattab@gmail.com>2014-05-07 21:47:47 +0200
commitf31f0ffa700f860a6d4492bdb3b5c0dee6d565d7 (patch)
treef717e56bbd48510cc58dfc8d564e2b18df1bf28a /js
parent3eb7038a153b12245cffbc840a727a764d82b333 (diff)
downloadfosdem-2018-presentation-f31f0ffa700f860a6d4492bdb3b5c0dee6d565d7.tar
fosdem-2018-presentation-f31f0ffa700f860a6d4492bdb3b5c0dee6d565d7.tar.gz
createSingletonNode now ensures found nodes are in the correct container
Diffstat (limited to 'js')
-rw-r--r--js/reveal.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/js/reveal.js b/js/reveal.js
index 11d6cda..cccc387 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -519,14 +519,17 @@
function createSingletonNode( container, tagname, classname, innerHTML ) {
var node = container.querySelector( '.' + classname );
- if( !node ) {
+
+ // If no node was found or the node is inside another container
+ if( !node || node.parentNode !== container ) {
node = document.createElement( tagname );
node.classList.add( classname );
- if( innerHTML !== null ) {
+ if( typeof innerHTML === 'string' ) {
node.innerHTML = innerHTML;
}
container.appendChild( node );
}
+
return node;
}
@@ -2093,7 +2096,7 @@
function updateProgress() {
// Update progress if enabled
- if( config.progress && dom.progress ) {
+ if( config.progress && dom.progressbar ) {
dom.progressbar.style.width = getProgress() * window.innerWidth + 'px';