fix up javascript errors

This commit is contained in:
Connor Turland 2016-03-14 21:36:16 +11:00
parent 579c36ec75
commit f24def8be6
2 changed files with 7 additions and 7 deletions

View file

@ -108,7 +108,7 @@ Metamaps.JIT = {
_.each(results[1], function (synapse) {
mapping = synapse.getMapping();
Metamaps.Synapses.remove(synapse);
Metamaps.Mappings.remove(mapping);
if (Metamaps.Mappings) Metamaps.Mappings.remove(mapping);
});
if (self.vizData.length == 0) {

View file

@ -4023,11 +4023,11 @@ Metamaps.Topic = {
nodeOnViz.setPos(new $jit.Complex(mapping.get('xloc'), mapping.get('yloc')), "end");
}
if (Metamaps.Create.newTopic.addSynapse && permitCreateSynapseAfter) {
Metamaps.Create.newSynapse.topic1id = tempNode.getData('topic').id;
Metamaps.Create.newSynapse.topic1id = Metamaps.tempNode.getData('topic').id;
// position the form
midpoint.x = tempNode.pos.getc().x + (nodeOnViz.pos.getc().x - tempNode.pos.getc().x) / 2;
midpoint.y = tempNode.pos.getc().y + (nodeOnViz.pos.getc().y - tempNode.pos.getc().y) / 2;
midpoint.x = Metamaps.tempNode.pos.getc().x + (nodeOnViz.pos.getc().x - Metamaps.tempNode.pos.getc().x) / 2;
midpoint.y = Metamaps.tempNode.pos.getc().y + (nodeOnViz.pos.getc().y - Metamaps.tempNode.pos.getc().y) / 2;
pixelPos = Metamaps.Util.coordsToPixels(midpoint);
$('#new_synapse').css('left', pixelPos.x + "px");
$('#new_synapse').css('top', pixelPos.y + "px");
@ -4037,9 +4037,9 @@ Metamaps.Topic = {
modes: ["node-property:dim"],
duration: 500,
onComplete: function () {
tempNode = null;
tempNode2 = null;
tempInit = false;
Metamaps.tempNode = null;
Metamaps.tempNode2 = null;
Metamaps.tempInit = false;
}
});
} else {