ONOS-1768 - GUI -- Tooltip doesn't appear on new view if switching by button, minor table height bug fix.
Change-Id: I443d13bb74ea5bae2948932153ca5a521b2b0fef
diff --git a/web/gui/src/main/webapp/app/fw/widget/button.js b/web/gui/src/main/webapp/app/fw/widget/button.js
index 0f97fdd..721f604 100644
--- a/web/gui/src/main/webapp/app/fw/widget/button.js
+++ b/web/gui/src/main/webapp/app/fw/widget/button.js
@@ -21,7 +21,7 @@
'use strict';
// injected refs
- var $log, fs, is, tts;
+ var $log, $rootScope, fs, is, tts;
// configuration
var btnSize = 25,
@@ -52,6 +52,9 @@
function addTooltip(elem, tooltip) {
elem.on('mouseover', function () { tts.showTooltip(this, tooltip); });
elem.on('mouseout', function () { tts.cancelTooltip(this); });
+ $rootScope.$on('$routeChangeStart', function () {
+ tts.cancelTooltip(elem.node());
+ });
}
@@ -251,10 +254,11 @@
angular.module('onosWidget')
.factory('ButtonService',
- ['$log', 'FnService', 'IconService', 'TooltipService',
+ ['$log', '$rootScope', 'FnService', 'IconService', 'TooltipService',
- function (_$log_, _fs_, _is_, _tts_) {
+ function (_$log_, _$rootScope_, _fs_, _is_, _tts_) {
$log = _$log_;
+ $rootScope = _$rootScope_;
fs = _fs_;
is = _is_;
tts = _tts_;
diff --git a/web/gui/src/main/webapp/app/fw/widget/table.js b/web/gui/src/main/webapp/app/fw/widget/table.js
index caacab4..0ed0b42 100644
--- a/web/gui/src/main/webapp/app/fw/widget/table.js
+++ b/web/gui/src/main/webapp/app/fw/widget/table.js
@@ -25,7 +25,7 @@
// constants
var tableIconTdSize = 33,
- pdg = 12,
+ pdg = 22,
colWidth = 'col-width',
tableIcon = 'table-icon',
asc = 'asc',
diff --git a/web/gui/src/main/webapp/app/fw/widget/tooltip.js b/web/gui/src/main/webapp/app/fw/widget/tooltip.js
index d08393c..46b5f80 100644
--- a/web/gui/src/main/webapp/app/fw/widget/tooltip.js
+++ b/web/gui/src/main/webapp/app/fw/widget/tooltip.js
@@ -26,8 +26,8 @@
// constants
var hoverHeight = 35,
- hoverDelay = 100,
- exitDelay = 100;
+ hoverDelay = 150,
+ exitDelay = 150;
// internal state
var tooltip, currElemId;
@@ -104,10 +104,6 @@
}
}
- function resetTooltip() {
- tooltip.style('display', 'none').text('');
- }
-
angular.module('onosWidget')
.factory('TooltipService', ['$log', 'FnService',
@@ -119,8 +115,7 @@
return {
showTooltip: showTooltip,
- cancelTooltip: cancelTooltip,
- resetTooltip: resetTooltip
+ cancelTooltip: cancelTooltip
};
}]);
}());