diff options
| author | rr- <rr-@sakuya.pl> | 2016-04-14 13:42:47 +0200 |
|---|---|---|
| committer | rr- <rr-@sakuya.pl> | 2016-04-14 17:50:38 +0200 |
| commit | 90559ffcdb13135bd77cb76c9a83f0cf595b6747 (patch) | |
| tree | 1510c5ea27fbf584e84eb9250be290a267a6a248 /client | |
| parent | 7cf4e6c37d05da36614b1d1e7afc005bc18882f9 (diff) | |
client/build: fix IE11 transpiling
Diffstat (limited to 'client')
| -rw-r--r-- | client/build.js | 2 | ||||
| -rw-r--r-- | client/js/util/views.js | 29 |
2 files changed, 12 insertions, 19 deletions
diff --git a/client/build.js b/client/build.js index bab4972..a1eac06 100644 --- a/client/build.js +++ b/client/build.js @@ -73,7 +73,7 @@ function bundleHtml(config) { const templatesHolder = util.format( '<script type=\'text/javascript\'>' + - 'const templates = %s;' + + 'var templates = %s;' + '</script>', JSON.stringify(templates)); diff --git a/client/js/util/views.js b/client/js/util/views.js index c0aabc6..a7d9888 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); - } - 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); + while (target.lastChild) { + target.removeChild(target.lastChild); + } + 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); + } } module.exports = { |