removeContent: also remove from dataTargets

This commit is contained in:
Nils Schneider 2015-04-02 22:10:11 +02:00
parent c4383aabb9
commit 0a0b8bd065

View File

@ -13,11 +13,16 @@ function (chroma, Map, Sidebar, Tabs, Container, Meshstats, Linklist,
var linkScale = chroma.scale(chroma.interpolate.bezier(["green", "yellow", "red"])).domain([1, 5]) var linkScale = chroma.scale(chroma.interpolate.bezier(["green", "yellow", "red"])).domain([1, 5])
var sidebar var sidebar
function dataTargetRemove(d) {
dataTargets = dataTargets.filter( function (e) { return d !== e })
}
function removeContent() { function removeContent() {
if (!content) if (!content)
return return
router.removeTarget(content) router.removeTarget(content)
dataTargetRemove(content)
content.destroy() content.destroy()
contentDiv.removeChild(content.div) contentDiv.removeChild(content.div)
content = null content = null