Merge pull request #1117 from epidemian/remove-peristent-unloaders
Remove unloaders when root element is removed
This commit is contained in:
commit
0294293f82
2 changed files with 3 additions and 64 deletions
|
|
@ -1473,6 +1473,7 @@
|
||||||
components.splice(index, 1)
|
components.splice(index, 1)
|
||||||
reset(root)
|
reset(root)
|
||||||
nodeCache.splice(getCellCacheKey(root), 1)
|
nodeCache.splice(getCellCacheKey(root), 1)
|
||||||
|
unloaders = []
|
||||||
}
|
}
|
||||||
|
|
||||||
var redrawing = false
|
var redrawing = false
|
||||||
|
|
|
||||||
|
|
@ -102,8 +102,7 @@ describe("m.route()", function () {
|
||||||
expect(route2).to.equal("/test13")
|
expect(route2).to.equal("/test13")
|
||||||
})
|
})
|
||||||
|
|
||||||
// FIXME: this causes others to fail
|
dit("skips route change if component ctrl.onunload calls preventDefault", function (root) { // eslint-disable-line
|
||||||
xdit("skips route change if component ctrl.onunload calls preventDefault", function (root) { // eslint-disable-line
|
|
||||||
mode("search")
|
mode("search")
|
||||||
var spy = sinon.spy()
|
var spy = sinon.spy()
|
||||||
|
|
||||||
|
|
@ -130,68 +129,7 @@ describe("m.route()", function () {
|
||||||
expect(spy).to.not.have.been.called
|
expect(spy).to.not.have.been.called
|
||||||
})
|
})
|
||||||
|
|
||||||
// FIXME: this causes others to fail
|
dit("skips route change if subcomponent ctrl.onunload calls preventDefault", function (root) { // eslint-disable-line
|
||||||
xdit("skips route change if subcomponent ctrl.onunload calls preventDefault", function (root) { // eslint-disable-line
|
|
||||||
mode("search")
|
|
||||||
|
|
||||||
var spy = sinon.spy()
|
|
||||||
|
|
||||||
var subsub = {
|
|
||||||
controller: function () {
|
|
||||||
this.onunload = function (e) { e.preventDefault() }
|
|
||||||
},
|
|
||||||
view: function () {
|
|
||||||
return m("div")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var sub = pure(function () { return subsub })
|
|
||||||
|
|
||||||
route(root, "/a", {
|
|
||||||
"/a": pure(function () { return sub }),
|
|
||||||
|
|
||||||
"/b": {
|
|
||||||
controller: spy,
|
|
||||||
view: noop
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
route("/b")
|
|
||||||
|
|
||||||
expect(spy).to.not.have.been.called
|
|
||||||
})
|
|
||||||
|
|
||||||
// FIXME: this causes others to fail
|
|
||||||
xdit("skips route change if non-curried component ctrl.onunload calls preventDefault", function (root) { // eslint-disable-line
|
|
||||||
mode("search")
|
|
||||||
|
|
||||||
var spy = sinon.spy()
|
|
||||||
|
|
||||||
var sub = {
|
|
||||||
controller: function () {
|
|
||||||
this.onunload = function (e) { e.preventDefault() }
|
|
||||||
},
|
|
||||||
view: function () {
|
|
||||||
return m("div")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
route(root, "/a", {
|
|
||||||
"/a": pure(function () { return sub }),
|
|
||||||
|
|
||||||
"/b": {
|
|
||||||
controller: spy,
|
|
||||||
view: noop
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
route("/b")
|
|
||||||
|
|
||||||
expect(spy).to.not.have.been.called
|
|
||||||
})
|
|
||||||
|
|
||||||
// FIXME: this causes others to fail
|
|
||||||
xdit("skips route change if non-curried subcomponent ctrl.onunload calls preventDefault", function (root) { // eslint-disable-line
|
|
||||||
mode("search")
|
mode("search")
|
||||||
|
|
||||||
var spy = sinon.spy()
|
var spy = sinon.spy()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue