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

View File

@ -107,18 +107,15 @@
});
}
if (obj !=null)
{
if (obj.class === 'link') {
if (selections[obj.key]) {
deselectObject(obj.key);
} else {
selections[obj.key] = { obj: obj, el: el };
selectOrder.push(obj.key);
}
updateDetail();
return;
if (obj && obj.class === 'link') {
if (selections[obj.key]) {
deselectObject(obj.key);
} else {
selections[obj.key] = { obj: obj, el: el };
selectOrder.push(obj.key);
}
updateDetail();
return;
}
if (!n) {