ONOS-5403: cleaned up code change to match coding style.

Change-Id: If1ba37d8f4b6d3296a057bbf2dfa042ed2051eab
This commit is contained in:
Simon Hunt 2016-11-19 09:06:17 -08:00
parent 0cf084b162
commit f9761458ec
2 changed files with 25 additions and 33 deletions

View File

@ -117,18 +117,18 @@
minDist = proximity * 2; minDist = proximity * 2;
network.links.forEach(function (d) { network.links.forEach(function (d) {
var line = d.position,
point,
hit,
dist;
if (!api.showHosts() && d.type() === 'hostLink') { if (!api.showHosts() && d.type() === 'hostLink') {
return; // skip hidden host links return; // skip hidden host links
} }
if(d.position != null) if (line) {
{ point = pdrop(line, mouse);
var line = d.position, hit = lineHit(line, point, mouse);
point = pdrop(line, mouse),
hit = lineHit(line, point, mouse),
dist;
}
if (hit) { if (hit) {
dist = mdist(point, mouse); dist = mdist(point, mouse);
if (dist < minDist) { if (dist < minDist) {
@ -136,6 +136,7 @@
nearest = d; nearest = d;
} }
} }
}
}); });
} }
return nearest; return nearest;
@ -225,17 +226,11 @@
tss.deselectAll(); tss.deselectAll();
if(ldata != null) if (ldata) {
{
if (!ldata.el.classed('selected')) {
selLink(ldata);
return;
}
if (ldata.el.classed('selected')) { if (ldata.el.classed('selected')) {
unselLink(ldata); unselLink(ldata);
return; } else {
selLink(ldata);
} }
} }
} }

View File

@ -107,9 +107,7 @@
}); });
} }
if (obj !=null) if (obj && obj.class === 'link') {
{
if (obj.class === 'link') {
if (selections[obj.key]) { if (selections[obj.key]) {
deselectObject(obj.key); deselectObject(obj.key);
} else { } else {
@ -119,7 +117,6 @@
updateDetail(); updateDetail();
return; return;
} }
}
if (!n) { if (!n) {
return; return;