GUI -- Topo Toolbar is destroyed after view is rerouted.
Change-Id: I10085d3b8b77756fac988633dc8b930e433f81fd
Showing
2 changed files
with
10 additions
and
1 deletions
... | @@ -287,6 +287,7 @@ | ... | @@ -287,6 +287,7 @@ |
287 | tps.destroyPanels(); | 287 | tps.destroyPanels(); |
288 | tis.destroyInst(); | 288 | tis.destroyInst(); |
289 | tfs.destroyForce(); | 289 | tfs.destroyForce(); |
290 | + ttbs.destroyToolbar(); | ||
290 | }); | 291 | }); |
291 | 292 | ||
292 | // svg layer and initialization of components | 293 | // svg layer and initialization of components | ... | ... |
... | @@ -27,6 +27,9 @@ | ... | @@ -27,6 +27,9 @@ |
27 | // internal state | 27 | // internal state |
28 | var toolbar, keyData; | 28 | var toolbar, keyData; |
29 | 29 | ||
30 | + // constants | ||
31 | + var name = 'topo-tbar'; | ||
32 | + | ||
30 | // key to button mapping data | 33 | // key to button mapping data |
31 | var k2b = { | 34 | var k2b = { |
32 | O: { id: 'summary-tog', gid: 'summary', isel: true}, | 35 | O: { id: 'summary-tog', gid: 'summary', isel: true}, |
... | @@ -71,11 +74,15 @@ | ... | @@ -71,11 +74,15 @@ |
71 | 74 | ||
72 | function createToolbar() { | 75 | function createToolbar() { |
73 | initKeyData(); | 76 | initKeyData(); |
74 | - toolbar = tbs.createToolbar('topo-tbar'); | 77 | + toolbar = tbs.createToolbar(name); |
75 | addFirstRow(); | 78 | addFirstRow(); |
76 | toolbar.show(); | 79 | toolbar.show(); |
77 | } | 80 | } |
78 | 81 | ||
82 | + function destroyToolbar() { | ||
83 | + tbs.destroyToolbar(name); | ||
84 | + } | ||
85 | + | ||
79 | // allows us to ensure the button states track key strokes | 86 | // allows us to ensure the button states track key strokes |
80 | function keyListener(key) { | 87 | function keyListener(key) { |
81 | var v = keyData.get(key); | 88 | var v = keyData.get(key); |
... | @@ -99,6 +106,7 @@ | ... | @@ -99,6 +106,7 @@ |
99 | return { | 106 | return { |
100 | init: init, | 107 | init: init, |
101 | createToolbar: createToolbar, | 108 | createToolbar: createToolbar, |
109 | + destroyToolbar: destroyToolbar, | ||
102 | keyListener: keyListener | 110 | keyListener: keyListener |
103 | }; | 111 | }; |
104 | }]); | 112 | }]); | ... | ... |
-
Please register or login to post a comment