فهرست منبع

HUE-3511 [assist] Reduce flickering of action icons when moving the pointer across several entries

Johan Ahlen 9 سال پیش
والد
کامیت
b8e2dd7
1فایلهای تغییر یافته به همراه8 افزوده شده و 3 حذف شده
  1. 8 3
      desktop/core/src/desktop/static/desktop/js/ko.hue-bindings.js

+ 8 - 3
desktop/core/src/desktop/static/desktop/js/ko.hue-bindings.js

@@ -122,17 +122,19 @@
       var $element  = $(element);
 
       var selector = options.selector;
+      var showTimeout = -1;
       var hideTimeout = -1;
       ko.utils.domData.set(element, 'visibleOnHover.override', ko.utils.unwrapObservable(options.override) || false)
       var inside = false;
 
       var show = function () {
         $element.find(selector).fadeTo("fast", 1);
-        clearTimeout(hideTimeout);
+        window.clearTimeout(hideTimeout);
       };
 
       var hide = function () {
         if (! inside) {
+          window.clearTimeout(showTimeout);
           hideTimeout = window.setTimeout(function () {
             $element.find(selector).fadeTo("fast", 0);
           }, 10);
@@ -147,11 +149,14 @@
       }
 
       $element.mouseenter(function () {
-        inside = true;
-        show();
+        showTimeout = window.setTimeout(function () {
+          inside = true;
+          show();
+        }, 300);
       });
 
       $element.mouseleave(function () {
+        window.clearTimeout(showTimeout);
         inside = false;
         if (! ko.utils.domData.get(element, 'visibleOnHover.override')) {
           hide();