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( const templatesHolder = util.format(
'<script type=\'text/javascript\'>' + '<script type=\'text/javascript\'>' +
'const templates = %s;' + 'var templates = %s;' +
'</script>', '</script>',
JSON.stringify(templates)); JSON.stringify(templates));

View file

@ -112,25 +112,18 @@ function enableForm(form) {
} }
function showView(target, source) { function showView(target, source) {
return new Promise((resolve, reject) => { while (target.lastChild) {
let observer = new MutationObserver(mutations => { target.removeChild(target.lastChild);
resolve(); }
observer.disconnect(); if (source instanceof NodeList) {
}); for (let child of source) {
observer.observe(target, {childList: true}); target.appendChild(child);
while (target.lastChild) {
target.removeChild(target.lastChild);
} }
if (source instanceof NodeList) { } else if (source instanceof Node) {
for (let child of source) { target.appendChild(source);
target.appendChild(child); } else {
} console.error('Invalid view source', source);
} else if (source instanceof Node) { }
target.appendChild(source);
} else {
console.error('Invalid view source', source);
}
});
} }
module.exports = { module.exports = {