Topo2: LinkLabels on an edge link are only visible if the host is shown
Change-Id: I6b2835115e36a87fdfba6d054dfe5973d5d36bad
diff --git a/web/gui/src/main/webapp/app/view/topo2/topo2Link.js b/web/gui/src/main/webapp/app/view/topo2/topo2Link.js
index 6954920..ebcd352 100644
--- a/web/gui/src/main/webapp/app/view/topo2/topo2Link.js
+++ b/web/gui/src/main/webapp/app/view/topo2/topo2Link.js
@@ -392,6 +392,10 @@
var visible = ps.getPrefs('topo2_prefs')['hosts'];
this.el.style('visibility', visible ? 'visible' : 'hidden');
+
+ if (this.linkLabel) {
+ this.linkLabel.setVisibility(visible);
+ }
},
displayMastership: function () {
this.set({ mastership: t2mss.mastership() !== null});
diff --git a/web/gui/src/main/webapp/app/view/topo2/topo2LinkLabel.js b/web/gui/src/main/webapp/app/view/topo2/topo2LinkLabel.js
index 66b06e5..fe748c3 100644
--- a/web/gui/src/main/webapp/app/view/topo2/topo2LinkLabel.js
+++ b/web/gui/src/main/webapp/app/view/topo2/topo2LinkLabel.js
@@ -50,6 +50,9 @@
y: (link.source.y + link.target.y) / 2
});
},
+ setVisibility: function (visible) {
+ this.el.style('visibility', visible ? 'visible' : 'hidden');
+ },
setScale: function () {
this.content.style('transform',
'scale(' + t2zs.adjustmentScale(20, 30) + ')');