Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// This is for to force a repaint,
// which is necessary in order to transition styles when adding a class name.
element.scrollTop;
// add active class after repaint
this.addClass(activeClassName);
// if we're animating a class removal
// we need to remove the class
if (animationType === 'remove') {
this.removeClass(transitionClass);
}
// wait for ember to apply classes
// set timeout for animation end
await sleep(computeTimeout(element) || 0);
this.removeClass(className);
this.removeClass(activeClassName);
}