Bug 1520467 - Fix facet-discrete animation. r=mkmelin
authorArshad Khan <arshdkhn1@gmail.com>
Wed, 16 Jan 2019 20:29:44 +0530
changeset 34273 9e7712f9a4d22412056ca728cf4d72412706d23d
parent 34272 6c49bd73b927ad95b5e49a50f84a9372374a03fb
child 34274 ebda63c9e0b19eadccae7fd6e873d3f894901a5c
push id389
push userclokep@gmail.com
push dateMon, 18 Mar 2019 19:01:53 +0000
reviewersmkmelin
bugs1520467
Bug 1520467 - Fix facet-discrete animation. r=mkmelin
mail/base/content/glodaFacet.js
--- a/mail/base/content/glodaFacet.js
+++ b/mail/base/content/glodaFacet.js
@@ -781,31 +781,33 @@ class MozFacetDiscrete extends HTMLEleme
 
       if (callback) {
         setTimeout(callback, 50);
       }
     });
 
     document.body.appendChild(flyingNode);
 
+    // Adding setTimeout to improve the facet-discrete animation.
+    // See Bug 1439323 for more detail.
     setTimeout(() => {
       // animate the flying clone... flying!
       window.requestAnimationFrame(() => {
         flyingNode.style.top = dest.top + "px";
         flyingNode.style.left = dest.left + "px";
       });
 
       // hide the target (cloned) node
       targetNode.style.display = "none";
 
       // hide the original node and remove its JS properties
       barNode.style.visibility = "hidden";
       delete barNode.groupValue;
       delete barNode.groupItems;
-    }, 0);
+    }, 100);
   }
 
   barClicked(barNode, variety) {
     let groupValue = barNode.groupValue;
     // These determine what goAnimate actually does.
     // flyAway allows us to cancel flying in the case the constraint is
     //  being fully dropped and so the facet is just going to get rebuilt
     let flyAway = true;