From e7a52dc14e74c5bccabfbd1d015b5b8bf56350e0 Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Thu, 12 Jan 2017 14:11:01 -0500 Subject: [PATCH] bugs --- frontend/src/Metamaps/Cable.js | 2 +- frontend/src/Metamaps/Engine.js | 2 +- frontend/src/Metamaps/Visualize.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/Metamaps/Cable.js b/frontend/src/Metamaps/Cable.js index 02f6dabd..0c4a4680 100644 --- a/frontend/src/Metamaps/Cable.js +++ b/frontend/src/Metamaps/Cable.js @@ -28,7 +28,7 @@ const Cable = { }, unsubscribeFromMap: () => { let self = Cable - self.sub.unsubscribe() + self.sub && self.sub.unsubscribe() delete self.sub }, synapseAdded: event => { diff --git a/frontend/src/Metamaps/Engine.js b/frontend/src/Metamaps/Engine.js index 39215ea9..06518532 100644 --- a/frontend/src/Metamaps/Engine.js +++ b/frontend/src/Metamaps/Engine.js @@ -36,7 +36,7 @@ const Engine = { Engine.runner = Matter.Runner.run(Engine.engine) }, endActiveMap: () => { - Runner.stop(Engine.runner) + Engine.runner && Runner.stop(Engine.runner) Matter.Engine.clear(Engine.engine) }, setNodePos: (id, x, y) => { diff --git a/frontend/src/Metamaps/Visualize.js b/frontend/src/Metamaps/Visualize.js index d38c0e8f..15247d36 100644 --- a/frontend/src/Metamaps/Visualize.js +++ b/frontend/src/Metamaps/Visualize.js @@ -159,6 +159,8 @@ const Visualize = { function runAnimation() { Loading.hide() + $('#new_topic').show() + $('#topic_name').focus() // load JSON data, if it's not empty if (!self.loadLater) { // load JSON data. @@ -178,8 +180,6 @@ const Visualize = { } else if (self.type === 'ForceDirected') { self.mGraph.plot() Engine.run(true) - $('#new_topic').show() - $('#topic_name').focus() } else if (self.type === 'ForceDirected3D') { self.mGraph.animate(JIT.ForceDirected.animateFDLayout) }