This commit is contained in:
Connor Turland 2017-01-12 14:11:01 -05:00
parent 149b7ecbd6
commit e7a52dc14e
3 changed files with 4 additions and 4 deletions

View file

@ -28,7 +28,7 @@ const Cable = {
}, },
unsubscribeFromMap: () => { unsubscribeFromMap: () => {
let self = Cable let self = Cable
self.sub.unsubscribe() self.sub && self.sub.unsubscribe()
delete self.sub delete self.sub
}, },
synapseAdded: event => { synapseAdded: event => {

View file

@ -36,7 +36,7 @@ const Engine = {
Engine.runner = Matter.Runner.run(Engine.engine) Engine.runner = Matter.Runner.run(Engine.engine)
}, },
endActiveMap: () => { endActiveMap: () => {
Runner.stop(Engine.runner) Engine.runner && Runner.stop(Engine.runner)
Matter.Engine.clear(Engine.engine) Matter.Engine.clear(Engine.engine)
}, },
setNodePos: (id, x, y) => { setNodePos: (id, x, y) => {

View file

@ -159,6 +159,8 @@ const Visualize = {
function runAnimation() { function runAnimation() {
Loading.hide() Loading.hide()
$('#new_topic').show()
$('#topic_name').focus()
// load JSON data, if it's not empty // load JSON data, if it's not empty
if (!self.loadLater) { if (!self.loadLater) {
// load JSON data. // load JSON data.
@ -178,8 +180,6 @@ const Visualize = {
} else if (self.type === 'ForceDirected') { } else if (self.type === 'ForceDirected') {
self.mGraph.plot() self.mGraph.plot()
Engine.run(true) Engine.run(true)
$('#new_topic').show()
$('#topic_name').focus()
} else if (self.type === 'ForceDirected3D') { } else if (self.type === 'ForceDirected3D') {
self.mGraph.animate(JIT.ForceDirected.animateFDLayout) self.mGraph.animate(JIT.ForceDirected.animateFDLayout)
} }