Merge pull request #380 from metamaps/bug-labelsDisappearing

when a topic was deleted, renderEdgeArrows was trying to call on a topic...
This commit is contained in:
Connor Turland 2015-01-28 21:35:20 -05:00
commit dbfc0e4f4d
2 changed files with 10 additions and 5 deletions

View file

@ -1758,7 +1758,9 @@ Metamaps.JIT = {
var posChild = adj.nodeTo.pos.getc(true);
//plot arrow edge
if (directionCat == "none") {
if (!direction) {
// render nothing for this arrow if the direction couldn't be retrieved
} else if (directionCat == "none") {
edgeHelper.line.render({
x: pos.x,
y: pos.y

View file

@ -356,10 +356,13 @@ Metamaps.Backbone.init = function () {
return Metamaps.Topics.get(this.get('node2_id'));
},
getDirection: function () {
return [
this.getTopic1().get('node').id,
this.getTopic2().get('node').id
];
var t1 = this.getTopic1(),
t2 = this.getTopic2();
return t1 && t2 ? [
t1.get('node').id,
t2.get('node').id
] : false;
},
getMapping: function () {