createSingletonNode now ensures found nodes are in the correct container
This commit is contained in:
parent
3eb7038a15
commit
f31f0ffa70
|
@ -519,14 +519,17 @@
|
||||||
function createSingletonNode( container, tagname, classname, innerHTML ) {
|
function createSingletonNode( container, tagname, classname, innerHTML ) {
|
||||||
|
|
||||||
var node = container.querySelector( '.' + classname );
|
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 = document.createElement( tagname );
|
||||||
node.classList.add( classname );
|
node.classList.add( classname );
|
||||||
if( innerHTML !== null ) {
|
if( typeof innerHTML === 'string' ) {
|
||||||
node.innerHTML = innerHTML;
|
node.innerHTML = innerHTML;
|
||||||
}
|
}
|
||||||
container.appendChild( node );
|
container.appendChild( node );
|
||||||
}
|
}
|
||||||
|
|
||||||
return node;
|
return node;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2093,7 +2096,7 @@
|
||||||
function updateProgress() {
|
function updateProgress() {
|
||||||
|
|
||||||
// Update progress if enabled
|
// Update progress if enabled
|
||||||
if( config.progress && dom.progress ) {
|
if( config.progress && dom.progressbar ) {
|
||||||
|
|
||||||
dom.progressbar.style.width = getProgress() * window.innerWidth + 'px';
|
dom.progressbar.style.width = getProgress() * window.innerWidth + 'px';
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue