GUI -- TopoView - implemented show/hide background map ('B' keystroke)
- reworked SvgUtilService.makeVisible() to be dual-purpose .visible(el, [b]) method.
Change-Id: I8e68994627d1022066cdc9dcbed006675431d91a
diff --git a/web/gui/src/main/webapp/app/view/topo/topo.js b/web/gui/src/main/webapp/app/view/topo/topo.js
index c413347..00b06d5 100644
--- a/web/gui/src/main/webapp/app/view/topo/topo.js
+++ b/web/gui/src/main/webapp/app/view/topo/topo.js
@@ -48,7 +48,7 @@
H: [tfs.toggleHosts, 'Toggle host visibility'],
M: [tfs.toggleOffline, 'Toggle offline visibility'],
- //B: [toggleBg, 'Toggle background image'],
+ B: [toggleMap, 'Toggle background map'],
//P: togglePorts,
//X: [toggleNodeLock, 'Lock / unlock node positions'],
@@ -94,6 +94,10 @@
tfs.updateDeviceColors();
}
+ function toggleMap() {
+ sus.visible(mapG, !sus.visible(mapG));
+ }
+
function resetZoom() {
zoomer.reset();
}
@@ -184,7 +188,7 @@
}
function showNoDevs(b) {
- sus.makeVisible(noDevsLayer, b);
+ sus.visible(noDevsLayer, b);
}
function showCallibrationPoints() {
diff --git a/web/gui/src/main/webapp/app/view/topo/topoForce.js b/web/gui/src/main/webapp/app/view/topo/topoForce.js
index 35c606f..8f15b947 100644
--- a/web/gui/src/main/webapp/app/view/topo/topoForce.js
+++ b/web/gui/src/main/webapp/app/view/topo/topoForce.js
@@ -365,21 +365,21 @@
}
function updateHostVisibility() {
- sus.makeVisible(nodeG.selectAll('.host'), showHosts);
- sus.makeVisible(linkG.selectAll('.hostLink'), showHosts);
+ sus.visible(nodeG.selectAll('.host'), showHosts);
+ sus.visible(linkG.selectAll('.hostLink'), showHosts);
}
function updateOfflineVisibility(dev) {
function updDev(d, show) {
- sus.makeVisible(d.el, show);
+ sus.visible(d.el, show);
tms.findAttachedLinks(d.id).forEach(function (link) {
b = show && ((link.type() !== 'hostLink') || showHosts);
- sus.makeVisible(link.el, b);
+ sus.visible(link.el, b);
});
tms.findAttachedHosts(d.id).forEach(function (host) {
b = show && showHosts;
- sus.makeVisible(host.el, b);
+ sus.visible(host.el, b);
});
}
@@ -721,7 +721,7 @@
textDy = r + 10;
d.el = node;
- sus.makeVisible(node, showHosts);
+ sus.visible(node, showHosts);
is.addHostIcon(node, r, gid);
@@ -849,7 +849,7 @@
d.el = link;
restyleLinkElement(d);
if (d.type() === 'hostLink') {
- sus.makeVisible(link, showHosts);
+ sus.visible(link, showHosts);
}
}