Committed by
Gerrit Code Review
GUI -- Cleaned up topoToolbar.
Change-Id: I07bb0248de27567101055977396b6aae072c979b
Showing
1 changed file
with
14 additions
and
9 deletions
| ... | @@ -26,8 +26,7 @@ | ... | @@ -26,8 +26,7 @@ |
| 26 | 26 | ||
| 27 | var api, toolbar; | 27 | var api, toolbar; |
| 28 | 28 | ||
| 29 | - // buttons (named for keystroke) | 29 | + // buttons |
| 30 | - var O, I, D, H, M, P, B; | ||
| 31 | var togSummary, togInstances, togDetails, | 30 | var togSummary, togInstances, togDetails, |
| 32 | togHosts, togOffline, togPorts, togBackground; | 31 | togHosts, togOffline, togPorts, togBackground; |
| 33 | 32 | ||
| ... | @@ -35,6 +34,10 @@ | ... | @@ -35,6 +34,10 @@ |
| 35 | api = _api_; | 34 | api = _api_; |
| 36 | } | 35 | } |
| 37 | 36 | ||
| 37 | + // TODO: fix toggle and radio sets to be selected based on the current state | ||
| 38 | + // current bug: first toggle button, then toggle with key, toggle button doesn't update appearance | ||
| 39 | + | ||
| 40 | + | ||
| 38 | function getActions() { | 41 | function getActions() { |
| 39 | togSummary = api.getActionEntry('O'); | 42 | togSummary = api.getActionEntry('O'); |
| 40 | togInstances = api.getActionEntry('I'); | 43 | togInstances = api.getActionEntry('I'); |
| ... | @@ -54,13 +57,10 @@ | ... | @@ -54,13 +57,10 @@ |
| 54 | return entry[1]; | 57 | return entry[1]; |
| 55 | } | 58 | } |
| 56 | 59 | ||
| 57 | - function createToolbar() { | 60 | + function addFirstRow() { |
| 58 | - getActions(); | ||
| 59 | - // in actions, function reference is entry[0], tooltip is entry[1] | ||
| 60 | - toolbar = tbs.createToolbar('topo-tbar'); | ||
| 61 | toolbar.addToggle('summary-tog', 'unknown', true, | 61 | toolbar.addToggle('summary-tog', 'unknown', true, |
| 62 | entryCallback(togSummary), entryToolTip(togSummary)); | 62 | entryCallback(togSummary), entryToolTip(togSummary)); |
| 63 | - toolbar.addToggle('instance-tog', 'unknown', true, | 63 | + toolbar.addToggle('instance-tog', 'uiAttached', true, |
| 64 | entryCallback(togInstances), entryToolTip(togInstances)); | 64 | entryCallback(togInstances), entryToolTip(togInstances)); |
| 65 | toolbar.addToggle('details-tog', 'unknown', true, | 65 | toolbar.addToggle('details-tog', 'unknown', true, |
| 66 | entryCallback(togDetails), entryToolTip(togDetails)); | 66 | entryCallback(togDetails), entryToolTip(togDetails)); |
| ... | @@ -68,14 +68,19 @@ | ... | @@ -68,14 +68,19 @@ |
| 68 | 68 | ||
| 69 | toolbar.addToggle('hosts-tog', 'endstation', false, | 69 | toolbar.addToggle('hosts-tog', 'endstation', false, |
| 70 | entryCallback(togHosts), entryToolTip(togHosts)); | 70 | entryCallback(togHosts), entryToolTip(togHosts)); |
| 71 | - toolbar.addToggle('offline-tog', 'unknown', true, | 71 | + toolbar.addToggle('offline-tog', 'switch', true, |
| 72 | entryCallback(togOffline), entryToolTip(togOffline)); | 72 | entryCallback(togOffline), entryToolTip(togOffline)); |
| 73 | toolbar.addToggle('ports-tog', 'unknown', true, | 73 | toolbar.addToggle('ports-tog', 'unknown', true, |
| 74 | entryCallback(togPorts), entryToolTip(togPorts)); | 74 | entryCallback(togPorts), entryToolTip(togPorts)); |
| 75 | toolbar.addToggle('bkgrnd-tog', 'unknown', true, | 75 | toolbar.addToggle('bkgrnd-tog', 'unknown', true, |
| 76 | entryCallback(togBackground), entryToolTip(togBackground)); | 76 | entryCallback(togBackground), entryToolTip(togBackground)); |
| 77 | + } | ||
| 77 | 78 | ||
| 78 | - toolbar.hide(); | 79 | + function createToolbar() { |
| 80 | + getActions(); | ||
| 81 | + toolbar = tbs.createToolbar('topo-tbar'); | ||
| 82 | + addFirstRow(); | ||
| 83 | + toolbar.show(); | ||
| 79 | } | 84 | } |
| 80 | 85 | ||
| 81 | angular.module('ovTopo') | 86 | angular.module('ovTopo') | ... | ... |
-
Please register or login to post a comment