Fixed innerHTML redrawing.
@@ -141,14 +141,13 @@ throw new Error(`[VNode] Specified child is not a VNode: ${c}`);
}); } - constructor(...args) { this.type = undefined; this.attributes = {}; this.data = {}; this.id = undefined; this.$key = undefined; - this.$html= undefined; + this.$html = undefined; this.style = undefined; this.value = undefined; this.children = [];@@ -188,7 +187,7 @@ if (typeof data === "string") {
// Assume single child text node this.type = "#text"; this.value = data; - return + return; } if (typeof data !== "object" || data === null) { throw new Error(@@ -378,11 +377,6 @@ node.addEventListener(a, newvnode.eventListeners[a]);
} }); oldvnode.eventListeners = newvnode.eventListeners; - } - // innerHTML - if (oldvnode.$html !== newvnode.$html) { - node.innerHTML = newvnode.$html; - oldvnode.$html = newvnode.$html; } // Children var newmap = []; // Map positions of newvnode children in relation to oldvnode children@@ -458,6 +452,11 @@ }
} } } + // innerHTML + if (oldvnode.$html !== newvnode.$html) { + node.innerHTML = newvnode.$html; + oldvnode.$html = newvnode.$html; + } } }@@ -577,7 +576,7 @@ // Display View
while (this.element.firstChild) { this.element.removeChild(this.element.firstChild); } - const vnode = this.routes[this.route.def]() + const vnode = this.routes[this.route.def](); this.element.appendChild(vnode.render()); this.setRedraw(vnode); this.store.dispatch("$navigation", this.route);@@ -617,7 +616,7 @@ // Initialize router
router = new Router({ element, routes, store }); return Promise.resolve(preStart && preStart()) .then(() => router.start()) - .then(() => postStart && postStart()) + .then(() => postStart && postStart()); }; h3.navigateTo = (path, params) => {
@@ -141,14 +141,13 @@ throw new Error(`[VNode] Specified child is not a VNode: ${c}`);
}); } - constructor(...args) { this.type = undefined; this.attributes = {}; this.data = {}; this.id = undefined; this.$key = undefined; - this.$html= undefined; + this.$html = undefined; this.style = undefined; this.value = undefined; this.children = [];@@ -188,7 +187,7 @@ if (typeof data === "string") {
// Assume single child text node this.type = "#text"; this.value = data; - return + return; } if (typeof data !== "object" || data === null) { throw new Error(@@ -378,11 +377,6 @@ node.addEventListener(a, newvnode.eventListeners[a]);
} }); oldvnode.eventListeners = newvnode.eventListeners; - } - // innerHTML - if (oldvnode.$html !== newvnode.$html) { - node.innerHTML = newvnode.$html; - oldvnode.$html = newvnode.$html; } // Children var newmap = []; // Map positions of newvnode children in relation to oldvnode children@@ -458,6 +452,11 @@ }
} } } + // innerHTML + if (oldvnode.$html !== newvnode.$html) { + node.innerHTML = newvnode.$html; + oldvnode.$html = newvnode.$html; + } } }@@ -577,7 +576,7 @@ // Display View
while (this.element.firstChild) { this.element.removeChild(this.element.firstChild); } - const vnode = this.routes[this.route.def]() + const vnode = this.routes[this.route.def](); this.element.appendChild(vnode.render()); this.setRedraw(vnode); this.store.dispatch("$navigation", this.route);@@ -617,7 +616,7 @@ // Initialize router
router = new Router({ element, routes, store }); return Promise.resolve(preStart && preStart()) .then(() => router.start()) - .then(() => postStart && postStart()) + .then(() => postStart && postStart()); }; h3.navigateTo = (path, params) => {
@@ -141,14 +141,13 @@ throw new Error(`[VNode] Specified child is not a VNode: ${c}`);
}); } - constructor(...args) { this.type = undefined; this.attributes = {}; this.data = {}; this.id = undefined; this.$key = undefined; - this.$html= undefined; + this.$html = undefined; this.style = undefined; this.value = undefined; this.children = [];@@ -188,7 +187,7 @@ if (typeof data === "string") {
// Assume single child text node this.type = "#text"; this.value = data; - return + return; } if (typeof data !== "object" || data === null) { throw new Error(@@ -378,11 +377,6 @@ node.addEventListener(a, newvnode.eventListeners[a]);
} }); oldvnode.eventListeners = newvnode.eventListeners; - } - // innerHTML - if (oldvnode.$html !== newvnode.$html) { - node.innerHTML = newvnode.$html; - oldvnode.$html = newvnode.$html; } // Children var newmap = []; // Map positions of newvnode children in relation to oldvnode children@@ -458,6 +452,11 @@ }
} } } + // innerHTML + if (oldvnode.$html !== newvnode.$html) { + node.innerHTML = newvnode.$html; + oldvnode.$html = newvnode.$html; + } } }@@ -577,7 +576,7 @@ // Display View
while (this.element.firstChild) { this.element.removeChild(this.element.firstChild); } - const vnode = this.routes[this.route.def]() + const vnode = this.routes[this.route.def](); this.element.appendChild(vnode.render()); this.setRedraw(vnode); this.store.dispatch("$navigation", this.route);@@ -617,7 +616,7 @@ // Initialize router
router = new Router({ element, routes, store }); return Promise.resolve(preStart && preStart()) .then(() => router.start()) - .then(() => postStart && postStart()) + .then(() => postStart && postStart()); }; h3.navigateTo = (path, params) => {