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
             };
         }]);
 }());
diff --git a/web/gui/src/main/webapp/app/view/device/device.js b/web/gui/src/main/webapp/app/view/device/device.js
index ce3eb4e..82348a7 100644
--- a/web/gui/src/main/webapp/app/view/device/device.js
+++ b/web/gui/src/main/webapp/app/view/device/device.js
@@ -265,7 +265,6 @@
             $scope.$on('$destroy', function () {
                 ps.destroyPanel(pName);
                 wss.unbindHandlers(handlers);
-                ttip.resetTooltip();
             });
 
             $log.log('OvDeviceCtrl has been created');
diff --git a/web/gui/src/main/webapp/app/view/topo/topo.js b/web/gui/src/main/webapp/app/view/topo/topo.js
index ed1dbc6..3c04e65 100644
--- a/web/gui/src/main/webapp/app/view/topo/topo.js
+++ b/web/gui/src/main/webapp/app/view/topo/topo.js
@@ -390,7 +390,6 @@
                 tis.destroyInst();
                 tfs.destroyForce();
                 ttbs.destroyToolbar();
-                ttip.resetTooltip();
             });
 
             // svg layer and initialization of components
diff --git a/web/gui/src/main/webapp/tests/app/fw/widget/table-spec.js b/web/gui/src/main/webapp/tests/app/fw/widget/table-spec.js
index 6df87b3..4f8f0c0 100644
--- a/web/gui/src/main/webapp/tests/app/fw/widget/table-spec.js
+++ b/web/gui/src/main/webapp/tests/app/fw/widget/table-spec.js
@@ -180,7 +180,7 @@
     }
 
     function verifyHeight() {
-        var padding = 12,
+        var padding = 22,
             mastHeight = 36,
             tableHeight = (mockWindow.innerHeight - mockHeaderHeight) -
                 (fs.noPx(headerDiv.css('height')) + mastHeight + padding);
diff --git a/web/gui/src/main/webapp/tests/app/fw/widget/tooltip-spec.js b/web/gui/src/main/webapp/tests/app/fw/widget/tooltip-spec.js
index 165b51d..0ae1f65 100644
--- a/web/gui/src/main/webapp/tests/app/fw/widget/tooltip-spec.js
+++ b/web/gui/src/main/webapp/tests/app/fw/widget/tooltip-spec.js
@@ -42,7 +42,7 @@
 
     it('should define api functions', function () {
         expect(fs.areFunctions(tts, [
-            'showTooltip', 'cancelTooltip', 'resetTooltip'
+            'showTooltip', 'cancelTooltip'
         ])).toBeTruthy();
     });