From 0a0b8bd065421e7060541e82184beddaff21317f Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Thu, 2 Apr 2015 22:10:11 +0200 Subject: [PATCH] removeContent: also remove from dataTargets --- lib/gui.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/gui.js b/lib/gui.js index fd05def..b859e05 100644 --- a/lib/gui.js +++ b/lib/gui.js @@ -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 sidebar + function dataTargetRemove(d) { + dataTargets = dataTargets.filter( function (e) { return d !== e }) + } + function removeContent() { if (!content) return router.removeTarget(content) + dataTargetRemove(content) content.destroy() contentDiv.removeChild(content.div) content = null