Fixing GUI to respond to server-side layout changes.
Change-Id: Ida1052d6bec4a92d29774ede47942410db189732
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 04b552c..44ed953 100644
--- a/web/gui/src/main/webapp/app/view/topo/topo.js
+++ b/web/gui/src/main/webapp/app/view/topo/topo.js
@@ -527,6 +527,11 @@
ps.setPrefs('topo_prefs', prefsState);
}
+ function applyPreferences(evt) {
+ if (ps.getPrefs('topo_prefs', null)) {
+ restoreConfigFromPrefs();
+ }
+ }
function restoreConfigFromPrefs() {
// NOTE: toolbar will have set this for us..
@@ -545,6 +550,7 @@
togglePorts(prefsState.porthl);
toggleMap(prefsState.bg);
toggleSprites(prefsState.spr);
+ ttbs.setToolbar(prefsState.toolbar);
t3s.setDevLabIndex(prefsState.dlbls);
t3s.setHostLabIndex(prefsState.hlbls);
flash.enable(true);
@@ -696,6 +702,8 @@
svg.attr(fs.windowSize(mast.mastHeight()));
dim = [svg.attr('width'), svg.attr('height')];
+ ps.addListener(applyPreferences);
+
setUpKeys();
setUpToolbar();
setUpDefs();