client/build: fix IE11 transpiling

This commit is contained in:
rr- 2016-04-14 13:42:47 +02:00
parent 7cf4e6c37d
commit 90559ffcdb
2 changed files with 12 additions and 19 deletions

View File

@ -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));

View File

@ -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 = {