Committed by
Gerrit Code Review
GUI -- Mobile GUI work. Disabled port highlighting, suppressed port highlighting…
…/sprite layer toolbar buttons, adjusted panel and navigation/mast heights. Change-Id: I36142be78167fc1eb73cc846e7222391cb8b8740
Showing
8 changed files
with
42 additions
and
20 deletions
... | @@ -34,6 +34,10 @@ | ... | @@ -34,6 +34,10 @@ |
34 | border-radius: 6px; | 34 | border-radius: 6px; |
35 | } | 35 | } |
36 | 36 | ||
37 | +html[data-platform='iPad'] .floatpanel { | ||
38 | + top: 80px; | ||
39 | +} | ||
40 | + | ||
37 | .light .floatpanel { | 41 | .light .floatpanel { |
38 | background-color: rgba(255,255,255,0.8); | 42 | background-color: rgba(255,255,255,0.8); |
39 | color: black; | 43 | color: black; | ... | ... |
... | @@ -24,7 +24,8 @@ | ... | @@ -24,7 +24,8 @@ |
24 | var $log; | 24 | var $log; |
25 | 25 | ||
26 | // configuration | 26 | // configuration |
27 | - var mastHeight = 36; | 27 | + var mastHeight = 36, |
28 | + padMobile = 16; | ||
28 | 29 | ||
29 | angular.module('onosMast', ['onosNav']) | 30 | angular.module('onosMast', ['onosNav']) |
30 | .controller('MastCtrl', ['$log', 'NavService', function (_$log_, ns) { | 31 | .controller('MastCtrl', ['$log', 'NavService', function (_$log_, ns) { |
... | @@ -44,9 +45,11 @@ | ... | @@ -44,9 +45,11 @@ |
44 | }]) | 45 | }]) |
45 | 46 | ||
46 | // also define a service to allow lookup of mast height. | 47 | // also define a service to allow lookup of mast height. |
47 | - .factory('MastService', [function () { | 48 | + .factory('MastService', ['FnService', function (fs) { |
48 | return { | 49 | return { |
49 | - mastHeight: function () { return mastHeight; } | 50 | + mastHeight: function () { |
51 | + return fs.isMobile() ? mastHeight + padMobile : mastHeight; | ||
52 | + } | ||
50 | } | 53 | } |
51 | }]); | 54 | }]); |
52 | 55 | ... | ... |
... | @@ -27,6 +27,10 @@ | ... | @@ -27,6 +27,10 @@ |
27 | visibility: hidden; | 27 | visibility: hidden; |
28 | } | 28 | } |
29 | 29 | ||
30 | +html[data-platform='iPad'] #nav { | ||
31 | + top: 57px; | ||
32 | +} | ||
33 | + | ||
30 | .light #nav { | 34 | .light #nav { |
31 | background-color: #bbb; | 35 | background-color: #bbb; |
32 | box-shadow: 0 2px 8px #777; | 36 | box-shadow: 0 2px 8px #777; | ... | ... |
... | @@ -34,7 +34,8 @@ | ... | @@ -34,7 +34,8 @@ |
34 | width: 20, | 34 | width: 20, |
35 | margin: 0, | 35 | margin: 0, |
36 | hideMargin: -20, | 36 | hideMargin: -20, |
37 | - top: '80%', | 37 | + top: 'auto', |
38 | + bottom: '10px', | ||
38 | fade: false, | 39 | fade: false, |
39 | shown: false | 40 | shown: false |
40 | }; | 41 | }; |
... | @@ -101,7 +102,8 @@ | ... | @@ -101,7 +102,8 @@ |
101 | }; | 102 | }; |
102 | 103 | ||
103 | panel.classed('toolbar', true) | 104 | panel.classed('toolbar', true) |
104 | - .style('top', settings.top); | 105 | + .style('top', settings.top) |
106 | + .style('bottom', settings.bottom); | ||
105 | 107 | ||
106 | // Helper functions | 108 | // Helper functions |
107 | 109 | ... | ... |
... | @@ -84,6 +84,9 @@ | ... | @@ -84,6 +84,9 @@ |
84 | /* Base css from panel.css */ | 84 | /* Base css from panel.css */ |
85 | top: 310px; | 85 | top: 310px; |
86 | } | 86 | } |
87 | +html[data-platform='iPad'] #topo-p-detail { | ||
88 | + top: 326px; | ||
89 | +} | ||
87 | 90 | ||
88 | #topo-p-detail .actionBtns .actionBtn { | 91 | #topo-p-detail .actionBtns .actionBtn { |
89 | display: inline-block; | 92 | display: inline-block; | ... | ... |
... | @@ -288,7 +288,7 @@ | ... | @@ -288,7 +288,7 @@ |
288 | td3 = _td3_; | 288 | td3 = _td3_; |
289 | svg = api.svg; | 289 | svg = api.svg; |
290 | network = api.network; | 290 | network = api.network; |
291 | - if (showPorts) { | 291 | + if (showPorts && !fs.isMobile()) { |
292 | svg.on('mousemove', mouseMoveHandler); | 292 | svg.on('mousemove', mouseMoveHandler); |
293 | } | 293 | } |
294 | svg.on('click', mouseClickHandler); | 294 | svg.on('click', mouseClickHandler); | ... | ... |
... | @@ -23,7 +23,7 @@ | ... | @@ -23,7 +23,7 @@ |
23 | 'use strict'; | 23 | 'use strict'; |
24 | 24 | ||
25 | // injected refs | 25 | // injected refs |
26 | - var $log, $window, $rootScope, fs, ps, gs, flash, wss, bns; | 26 | + var $log, $window, $rootScope, fs, ps, gs, flash, wss, bns, mast; |
27 | 27 | ||
28 | // constants | 28 | // constants |
29 | var pCls = 'topo-p', | 29 | var pCls = 'topo-p', |
... | @@ -32,12 +32,13 @@ | ... | @@ -32,12 +32,13 @@ |
32 | panelOpts = { | 32 | panelOpts = { |
33 | width: 260 | 33 | width: 260 |
34 | }, | 34 | }, |
35 | - sumFromTop = 64, | 35 | + sumMax = 226, |
36 | - sumMax = 226; | 36 | + padTop = 28; |
37 | 37 | ||
38 | // internal state | 38 | // internal state |
39 | var useDetails = true, // should we show details if we have 'em? | 39 | var useDetails = true, // should we show details if we have 'em? |
40 | - haveDetails = false; // do we have details that we could show? | 40 | + haveDetails = false, // do we have details that we could show? |
41 | + sumFromTop; // summary panel distance from top of screen | ||
41 | 42 | ||
42 | // panels | 43 | // panels |
43 | var summary, detail; | 44 | var summary, detail; |
... | @@ -396,8 +397,9 @@ | ... | @@ -396,8 +397,9 @@ |
396 | // ========================== | 397 | // ========================== |
397 | 398 | ||
398 | function augmentDetailPanel() { | 399 | function augmentDetailPanel() { |
399 | - var d = detail; | 400 | + var d = detail, |
400 | - d.ypos = { up: 64, down: 310, current: 310}; | 401 | + downPos = sumFromTop + sumMax + 20; |
402 | + d.ypos = { up: sumFromTop, down: downPos, current: downPos}; | ||
401 | 403 | ||
402 | d._move = function (y, cb) { | 404 | d._move = function (y, cb) { |
403 | var yp = d.ypos, | 405 | var yp = d.ypos, |
... | @@ -448,6 +450,7 @@ | ... | @@ -448,6 +450,7 @@ |
448 | // ========================== | 450 | // ========================== |
449 | 451 | ||
450 | function initPanels() { | 452 | function initPanels() { |
453 | + sumFromTop = mast.mastHeight() + padTop; | ||
451 | summary = createTopoPanel(idSum, panelOpts); | 454 | summary = createTopoPanel(idSum, panelOpts); |
452 | detail = createTopoPanel(idDet, panelOpts); | 455 | detail = createTopoPanel(idDet, panelOpts); |
453 | 456 | ||
... | @@ -469,10 +472,10 @@ | ... | @@ -469,10 +472,10 @@ |
469 | angular.module('ovTopo') | 472 | angular.module('ovTopo') |
470 | .factory('TopoPanelService', | 473 | .factory('TopoPanelService', |
471 | ['$log', '$window', '$rootScope', 'FnService', 'PanelService', 'GlyphService', | 474 | ['$log', '$window', '$rootScope', 'FnService', 'PanelService', 'GlyphService', |
472 | - 'FlashService', 'WebSocketService', 'ButtonService', | 475 | + 'FlashService', 'WebSocketService', 'ButtonService', 'MastService', |
473 | 476 | ||
474 | function (_$log_, _$window_, _$rootScope_, | 477 | function (_$log_, _$window_, _$rootScope_, |
475 | - _fs_, _ps_, _gs_, _flash_, _wss_, _bns_) { | 478 | + _fs_, _ps_, _gs_, _flash_, _wss_, _bns_, _mast_) { |
476 | $log = _$log_; | 479 | $log = _$log_; |
477 | $window = _$window_; | 480 | $window = _$window_; |
478 | $rootScope = _$rootScope_; | 481 | $rootScope = _$rootScope_; |
... | @@ -482,6 +485,7 @@ | ... | @@ -482,6 +485,7 @@ |
482 | flash = _flash_; | 485 | flash = _flash_; |
483 | wss = _wss_; | 486 | wss = _wss_; |
484 | bns = _bns_; | 487 | bns = _bns_; |
488 | + mast = _mast_; | ||
485 | 489 | ||
486 | return { | 490 | return { |
487 | initPanels: initPanels, | 491 | initPanels: initPanels, | ... | ... |
... | @@ -23,7 +23,7 @@ | ... | @@ -23,7 +23,7 @@ |
23 | 'use strict'; | 23 | 'use strict'; |
24 | 24 | ||
25 | // injected references | 25 | // injected references |
26 | - var $log, tbs, ps, api; | 26 | + var $log, fs, tbs, ps, api; |
27 | 27 | ||
28 | // internal state | 28 | // internal state |
29 | var toolbar, keyData, cachedState; | 29 | var toolbar, keyData, cachedState; |
... | @@ -124,8 +124,9 @@ | ... | @@ -124,8 +124,9 @@ |
124 | var v = keyData.get(key); | 124 | var v = keyData.get(key); |
125 | v.btn = toolbar.addButton(v.id, v.gid, v.cb, v.tt); | 125 | v.btn = toolbar.addButton(v.id, v.gid, v.cb, v.tt); |
126 | } | 126 | } |
127 | - function addToggle(key) { | 127 | + function addToggle(key, suppressIfMobile) { |
128 | var v = keyData.get(key); | 128 | var v = keyData.get(key); |
129 | + if (suppressIfMobile && fs.isMobile()) { return; } | ||
129 | v.tog = toolbar.addToggle(v.id, v.gid, v.isel, v.cb, v.tt); | 130 | v.tog = toolbar.addToggle(v.id, v.gid, v.isel, v.cb, v.tt); |
130 | } | 131 | } |
131 | 132 | ||
... | @@ -137,9 +138,9 @@ | ... | @@ -137,9 +138,9 @@ |
137 | 138 | ||
138 | addToggle('H'); | 139 | addToggle('H'); |
139 | addToggle('M'); | 140 | addToggle('M'); |
140 | - addToggle('P'); | 141 | + addToggle('P', true); |
141 | addToggle('B'); | 142 | addToggle('B'); |
142 | - addToggle('S'); | 143 | + addToggle('S', true); |
143 | } | 144 | } |
144 | function addSecondRow() { | 145 | function addSecondRow() { |
145 | //addToggle('X'); | 146 | //addToggle('X'); |
... | @@ -197,10 +198,11 @@ | ... | @@ -197,10 +198,11 @@ |
197 | 198 | ||
198 | angular.module('ovTopo') | 199 | angular.module('ovTopo') |
199 | .factory('TopoToolbarService', | 200 | .factory('TopoToolbarService', |
200 | - ['$log', 'ToolbarService', 'PrefsService', | 201 | + ['$log', 'FnService', 'ToolbarService', 'PrefsService', |
201 | 202 | ||
202 | - function (_$log_, _tbs_, _ps_) { | 203 | + function (_$log_, _fs_, _tbs_, _ps_) { |
203 | $log = _$log_; | 204 | $log = _$log_; |
205 | + fs = _fs_; | ||
204 | tbs = _tbs_; | 206 | tbs = _tbs_; |
205 | ps = _ps_; | 207 | ps = _ps_; |
206 | 208 | ... | ... |
-
Please register or login to post a comment