Bri Prebilic Cole

ONOS-1768 - GUI -- Tooltip doesn't appear on new view if switching by button, mi…

…nor table height bug fix.

Change-Id: I443d13bb74ea5bae2948932153ca5a521b2b0fef
......@@ -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_;
......
......@@ -25,7 +25,7 @@
// constants
var tableIconTdSize = 33,
pdg = 12,
pdg = 22,
colWidth = 'col-width',
tableIcon = 'table-icon',
asc = 'asc',
......
......@@ -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
};
}]);
}());
......
......@@ -265,7 +265,6 @@
$scope.$on('$destroy', function () {
ps.destroyPanel(pName);
wss.unbindHandlers(handlers);
ttip.resetTooltip();
});
$log.log('OvDeviceCtrl has been created');
......
......@@ -390,7 +390,6 @@
tis.destroyInst();
tfs.destroyForce();
ttbs.destroyToolbar();
ttip.resetTooltip();
});
// svg layer and initialization of components
......
......@@ -180,7 +180,7 @@ describe('factory: fw/widget/table.js', function () {
}
function verifyHeight() {
var padding = 12,
var padding = 22,
mastHeight = 36,
tableHeight = (mockWindow.innerHeight - mockHeaderHeight) -
(fs.noPx(headerDiv.css('height')) + mastHeight + padding);
......
......@@ -42,7 +42,7 @@ describe('factory: fw/widget/tooltip.js', function () {
it('should define api functions', function () {
expect(fs.areFunctions(tts, [
'showTooltip', 'cancelTooltip', 'resetTooltip'
'showTooltip', 'cancelTooltip'
])).toBeTruthy();
});
......