fix subtree directive bug that made first input copy value of current active one, if inside loop

This commit is contained in:
Leo Horie 2014-06-26 07:16:19 -04:00
parent 42f21181f8
commit 661307c02e
2 changed files with 14 additions and 2 deletions

View file

@ -34,7 +34,7 @@ Mithril = m = new function app(window) {
}
function build(parentElement, parentTag, parentCache, parentIndex, data, cached, shouldReattach, index, editable, namespace, configs) {
if (data === null || data === undefined) data = ""
if (data.subtree === "retain") return
if (data.subtree === "retain") return cached
var cachedType = type.call(cached), dataType = type.call(data)
if (cachedType != dataType) {