]> jaekl.net Git - quanweb.git/commitdiff
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 d417fefeb24eacddb96274f95fda3ec4d63ea89b..d2c48d93a288c24c482f0efd58ff876b893f9ee1 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 7af3e979d703e56db546e210a7a3a932778058fd..1bbb8aed10751611a863006c170175c05e4565bf 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 0311444416128ed589d57dc27f7449d8b686cd82..5e88238f91eaf13ba40d29c262d4ca47363fa3b2 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();
     };
     
     // ===============