Merge remote-tracking branch 'origin/next' into components

This commit is contained in:
Leo Horie 2015-03-13 22:55:02 -04:00
commit 9a9f0bd08e
2 changed files with 24 additions and 3 deletions

View file

@ -299,7 +299,7 @@ var m = (function app(window, undefined) {
}
//schedule configs to be called. They are called after `build` finishes running
if (typeof data.attrs["config"] === FUNCTION) {
var context = cached.configContext = cached.configContext || {retain: m.redraw.strategy() == "diff"};
var context = cached.configContext = cached.configContext || {retain: (m.redraw.strategy() == "diff") || undefined};
// bind
var callback = function(data, args) {

View file

@ -533,6 +533,27 @@ function testMithril(mock) {
return unloaded === true
})
test(function() {
mock.requestAnimationFrame.$resolve()
var root = mock.document.createElement("div")
var initCount = 0
var module = {}
module.view = function() {
return m("div", {config: function(el, init) {
if (!init) initCount++
}})
}
m.module(root, module)
mock.requestAnimationFrame.$resolve()
m.redraw()
mock.requestAnimationFrame.$resolve()
return initCount == 1
})
m.redraw.strategy(undefined) //teardown for m.module tests
//m.withAttr
@ -2239,7 +2260,7 @@ function testMithril(mock) {
"/a": a
})
return value === false
return !value
})
test(function() {
mock.requestAnimationFrame.$resolve()
@ -2260,7 +2281,7 @@ function testMithril(mock) {
"/a": a
})
return value === true
return value
})
test(function() {
mock.requestAnimationFrame.$resolve()