From 77342727370d80a102382f42c5761a8365d6a42a Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Sun, 25 Sep 2016 20:10:18 +0800 Subject: [PATCH] hide circles when transitioning from topic view to map view fixes #389 --- frontend/src/Metamaps/Router.js | 9 ++------- frontend/src/Metamaps/Visualize.js | 8 +++++++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/frontend/src/Metamaps/Router.js b/frontend/src/Metamaps/Router.js index 073c1d1b..8bcd3590 100644 --- a/frontend/src/Metamaps/Router.js +++ b/frontend/src/Metamaps/Router.js @@ -6,7 +6,6 @@ import Backbone from 'backbone' import Active from './Active' import GlobalUI from './GlobalUI' -import JIT from './JIT' import Map from './Map' import Topic from './Topic' import Views from './Views' @@ -170,9 +169,7 @@ const _Router = Backbone.Router.extend({ // clear the visualization, if there was one, before showing its div again if (Visualize.mGraph) { - Visualize.mGraph.graph.empty() - Visualize.mGraph.plot() - JIT.centerMap(Visualize.mGraph.canvas) + Visualize.clearVisualization() } GlobalUI.showDiv('#infovis') Topic.end() @@ -198,9 +195,7 @@ const _Router = Backbone.Router.extend({ // clear the visualization, if there was one, before showing its div again if (Visualize.mGraph) { - Visualize.mGraph.graph.empty() - Visualize.mGraph.plot() - JIT.centerMap(Visualize.mGraph.canvas) + Visualize.clearVisualization() } GlobalUI.showDiv('#infovis') Map.end() diff --git a/frontend/src/Metamaps/Visualize.js b/frontend/src/Metamaps/Visualize.js index df5bab99..3804b6a8 100644 --- a/frontend/src/Metamaps/Visualize.js +++ b/frontend/src/Metamaps/Visualize.js @@ -220,7 +220,13 @@ const Visualize = { Router.navigate('/topics/' + t.id) } }, 800) - } + }, + clearVisualization: function() { + Visualize.mGraph.graph.empty() + Visualize.mGraph.plot() + JIT.centerMap(Visualize.mGraph.canvas) + $('#infovis').empty() + }, } export default Visualize