Added context for config handlers

This commit is contained in:
Sergey Kirillov 2014-05-31 13:38:55 +03:00
parent 16e6f6fdd5
commit 20b102b478
2 changed files with 18 additions and 1 deletions

View file

@ -86,7 +86,7 @@ Mithril = m = new function app(window) {
cached.nodes.intact = true
if (shouldReattach === true) parentElement.insertBefore(node, parentElement.childNodes[index] || null)
}
if (type.call(data.attrs["config"]) == "[object Function]") data.attrs["config"](node, !isNew)
if (type.call(data.attrs["config"]) == "[object Function]") data.attrs["config"](node, !isNew, cached.config_context=cached.config_context || {})
}
else {
var node