Prevent tooltips from displaying when the mouse is over the search or paging controllers.
authorChris Jaekl <cejaekl@yahoo.com>
Tue, 21 Nov 2017 11:38:07 +0000 (20:38 +0900)
committerChris Jaekl <cejaekl@yahoo.com>
Tue, 21 Nov 2017 11:38:07 +0000 (20:38 +0900)
app/index.html
js/BooksView.js
js/ToolTip.js

index d417fef..d2c48d9 100644 (file)
@@ -7,7 +7,7 @@
   </head>
   
   <body onload="onSearch();"> 
-    <form>
+    <form onmouseenter="ToolTip.stopTooltipTimer();">
       <input id="search" onclick="onSearch();" type="button" value="Search"/> 
       <span class="term">Author: <input id="aut" type="text"/></span>
       <span class="term">Title: <input id="tit" type="text"/></span>
@@ -26,6 +26,6 @@
     <div id="details" class="tooltip" onclick="hideDetails();">(No information available)</div>
 
     <script src="modernizr-custom.js"></script>
-    <script src="all.js"></script>
+    <script src="lib.min.js"></script>
   </body>
 </html>
index 7af3e97..1bbb8ae 100644 (file)
@@ -48,7 +48,8 @@ var BooksView = (function() {
         }
         result     +=       '</a></td>'
             +       '<td onclick="displayDetails(' + book.Id + ');" '
-            +          ' onmouseover="ToolTip.startTooltipTimer(' + book.Id + ');">'
+            +          ' onmouseover="ToolTip.startTooltipTimer(' + book.Id + ');"'
+            +          ' onmouseleave="ToolTip.stopTooltipTimer();">'
             +         '<p><b>' + book.Title + '</b></p>'
             +         '<p>'
             +           '<i>' + book.AuthorReading + '</i>';
index 0311444..5e88238 100644 (file)
@@ -46,10 +46,11 @@ var ToolTip = (function () {
         
         var deltaX = Math.abs(x - mousePos.x);
         var deltaY = Math.abs(y - mousePos.y);
-        
-        if (  deltaX > threshold
-           || deltaY > threshold )
+
+        if (  (deltaX > threshold)
+           || (deltaY > threshold) )
         {
+            my.stopTooltipTimer();
             my.hideDetails();
         }
     };
@@ -104,7 +105,6 @@ var ToolTip = (function () {
         
         clearTimeout(timer);
         timer = undefined;
-        my.hideDetails();
     };
     
     // ===============