diff --git a/client/build.js b/client/build.js index bab4972a..a1eac069 100644 --- a/client/build.js +++ b/client/build.js @@ -73,7 +73,7 @@ function bundleHtml(config) { const templatesHolder = util.format( '', JSON.stringify(templates)); diff --git a/client/js/util/views.js b/client/js/util/views.js index c0aabc6e..a7d98885 100644 --- a/client/js/util/views.js +++ b/client/js/util/views.js @@ -112,25 +112,18 @@ function enableForm(form) { } function showView(target, source) { - return new Promise((resolve, reject) => { - let observer = new MutationObserver(mutations => { - resolve(); - observer.disconnect(); - }); - observer.observe(target, {childList: true}); - while (target.lastChild) { - target.removeChild(target.lastChild); + while (target.lastChild) { + target.removeChild(target.lastChild); + } + if (source instanceof NodeList) { + for (let child of source) { + target.appendChild(child); } - if (source instanceof NodeList) { - for (let child of source) { - target.appendChild(child); - } - } else if (source instanceof Node) { - target.appendChild(source); - } else { - console.error('Invalid view source', source); - } - }); + } else if (source instanceof Node) { + target.appendChild(source); + } else { + console.error('Invalid view source', source); + } } module.exports = {