ONOS-1768 - GUI -- Tooltip doesn't appear on new view if switching by button, mi…
…nor table height bug fix. Change-Id: I443d13bb74ea5bae2948932153ca5a521b2b0fef
Showing
7 changed files
with
13 additions
and
16 deletions
... | @@ -21,7 +21,7 @@ | ... | @@ -21,7 +21,7 @@ |
21 | 'use strict'; | 21 | 'use strict'; |
22 | 22 | ||
23 | // injected refs | 23 | // injected refs |
24 | - var $log, fs, is, tts; | 24 | + var $log, $rootScope, fs, is, tts; |
25 | 25 | ||
26 | // configuration | 26 | // configuration |
27 | var btnSize = 25, | 27 | var btnSize = 25, |
... | @@ -52,6 +52,9 @@ | ... | @@ -52,6 +52,9 @@ |
52 | function addTooltip(elem, tooltip) { | 52 | function addTooltip(elem, tooltip) { |
53 | elem.on('mouseover', function () { tts.showTooltip(this, tooltip); }); | 53 | elem.on('mouseover', function () { tts.showTooltip(this, tooltip); }); |
54 | elem.on('mouseout', function () { tts.cancelTooltip(this); }); | 54 | elem.on('mouseout', function () { tts.cancelTooltip(this); }); |
55 | + $rootScope.$on('$routeChangeStart', function () { | ||
56 | + tts.cancelTooltip(elem.node()); | ||
57 | + }); | ||
55 | } | 58 | } |
56 | 59 | ||
57 | 60 | ||
... | @@ -251,10 +254,11 @@ | ... | @@ -251,10 +254,11 @@ |
251 | 254 | ||
252 | angular.module('onosWidget') | 255 | angular.module('onosWidget') |
253 | .factory('ButtonService', | 256 | .factory('ButtonService', |
254 | - ['$log', 'FnService', 'IconService', 'TooltipService', | 257 | + ['$log', '$rootScope', 'FnService', 'IconService', 'TooltipService', |
255 | 258 | ||
256 | - function (_$log_, _fs_, _is_, _tts_) { | 259 | + function (_$log_, _$rootScope_, _fs_, _is_, _tts_) { |
257 | $log = _$log_; | 260 | $log = _$log_; |
261 | + $rootScope = _$rootScope_; | ||
258 | fs = _fs_; | 262 | fs = _fs_; |
259 | is = _is_; | 263 | is = _is_; |
260 | tts = _tts_; | 264 | tts = _tts_; | ... | ... |
... | @@ -25,7 +25,7 @@ | ... | @@ -25,7 +25,7 @@ |
25 | 25 | ||
26 | // constants | 26 | // constants |
27 | var tableIconTdSize = 33, | 27 | var tableIconTdSize = 33, |
28 | - pdg = 12, | 28 | + pdg = 22, |
29 | colWidth = 'col-width', | 29 | colWidth = 'col-width', |
30 | tableIcon = 'table-icon', | 30 | tableIcon = 'table-icon', |
31 | asc = 'asc', | 31 | asc = 'asc', | ... | ... |
... | @@ -26,8 +26,8 @@ | ... | @@ -26,8 +26,8 @@ |
26 | 26 | ||
27 | // constants | 27 | // constants |
28 | var hoverHeight = 35, | 28 | var hoverHeight = 35, |
29 | - hoverDelay = 100, | 29 | + hoverDelay = 150, |
30 | - exitDelay = 100; | 30 | + exitDelay = 150; |
31 | 31 | ||
32 | // internal state | 32 | // internal state |
33 | var tooltip, currElemId; | 33 | var tooltip, currElemId; |
... | @@ -104,10 +104,6 @@ | ... | @@ -104,10 +104,6 @@ |
104 | } | 104 | } |
105 | } | 105 | } |
106 | 106 | ||
107 | - function resetTooltip() { | ||
108 | - tooltip.style('display', 'none').text(''); | ||
109 | - } | ||
110 | - | ||
111 | angular.module('onosWidget') | 107 | angular.module('onosWidget') |
112 | .factory('TooltipService', ['$log', 'FnService', | 108 | .factory('TooltipService', ['$log', 'FnService', |
113 | 109 | ||
... | @@ -119,8 +115,7 @@ | ... | @@ -119,8 +115,7 @@ |
119 | 115 | ||
120 | return { | 116 | return { |
121 | showTooltip: showTooltip, | 117 | showTooltip: showTooltip, |
122 | - cancelTooltip: cancelTooltip, | 118 | + cancelTooltip: cancelTooltip |
123 | - resetTooltip: resetTooltip | ||
124 | }; | 119 | }; |
125 | }]); | 120 | }]); |
126 | }()); | 121 | }()); | ... | ... |
... | @@ -265,7 +265,6 @@ | ... | @@ -265,7 +265,6 @@ |
265 | $scope.$on('$destroy', function () { | 265 | $scope.$on('$destroy', function () { |
266 | ps.destroyPanel(pName); | 266 | ps.destroyPanel(pName); |
267 | wss.unbindHandlers(handlers); | 267 | wss.unbindHandlers(handlers); |
268 | - ttip.resetTooltip(); | ||
269 | }); | 268 | }); |
270 | 269 | ||
271 | $log.log('OvDeviceCtrl has been created'); | 270 | $log.log('OvDeviceCtrl has been created'); | ... | ... |
... | @@ -390,7 +390,6 @@ | ... | @@ -390,7 +390,6 @@ |
390 | tis.destroyInst(); | 390 | tis.destroyInst(); |
391 | tfs.destroyForce(); | 391 | tfs.destroyForce(); |
392 | ttbs.destroyToolbar(); | 392 | ttbs.destroyToolbar(); |
393 | - ttip.resetTooltip(); | ||
394 | }); | 393 | }); |
395 | 394 | ||
396 | // svg layer and initialization of components | 395 | // svg layer and initialization of components | ... | ... |
... | @@ -180,7 +180,7 @@ describe('factory: fw/widget/table.js', function () { | ... | @@ -180,7 +180,7 @@ describe('factory: fw/widget/table.js', function () { |
180 | } | 180 | } |
181 | 181 | ||
182 | function verifyHeight() { | 182 | function verifyHeight() { |
183 | - var padding = 12, | 183 | + var padding = 22, |
184 | mastHeight = 36, | 184 | mastHeight = 36, |
185 | tableHeight = (mockWindow.innerHeight - mockHeaderHeight) - | 185 | tableHeight = (mockWindow.innerHeight - mockHeaderHeight) - |
186 | (fs.noPx(headerDiv.css('height')) + mastHeight + padding); | 186 | (fs.noPx(headerDiv.css('height')) + mastHeight + padding); | ... | ... |
... | @@ -42,7 +42,7 @@ describe('factory: fw/widget/tooltip.js', function () { | ... | @@ -42,7 +42,7 @@ describe('factory: fw/widget/tooltip.js', function () { |
42 | 42 | ||
43 | it('should define api functions', function () { | 43 | it('should define api functions', function () { |
44 | expect(fs.areFunctions(tts, [ | 44 | expect(fs.areFunctions(tts, [ |
45 | - 'showTooltip', 'cancelTooltip', 'resetTooltip' | 45 | + 'showTooltip', 'cancelTooltip' |
46 | ])).toBeTruthy(); | 46 | ])).toBeTruthy(); |
47 | }); | 47 | }); |
48 | 48 | ... | ... |
-
Please register or login to post a comment