MCPcopy Index your code
hub / github.com/angular/angular / isLongestAnimation

Function isLongestAnimation

packages/core/src/animation/utils.ts:327–343  ·  view source on GitHub ↗
(
  event: AnimationEvent | TransitionEvent,
  nativeElement: HTMLElement,
)

Source from the content-addressed store, hash-verified

325 * @returns
326 */
327export function isLongestAnimation(
328 event: AnimationEvent | TransitionEvent,
329 nativeElement: HTMLElement,
330): boolean {
331 const longestAnimation = longestAnimations.get(nativeElement);
332 // If we don't have any record of a longest animation, then we shouldn't
333 // block the animationend/transitionend event from doing its work.
334 if (longestAnimation === undefined) return true;
335 return (
336 nativeElement === getEventTarget(event) &&
337 ((longestAnimation.animationName !== undefined &&
338 (event as AnimationEvent).animationName === longestAnimation.animationName) ||
339 (longestAnimation.propertyName !== undefined &&
340 (longestAnimation.propertyName === 'all' ||
341 (event as TransitionEvent).propertyName === longestAnimation.propertyName)))
342 );
343}
344
345/**
346 * Stores a given animation function in the LView's animation map for later execution

Callers 3

handleEnterAnimationEndFunction · 0.90
enterAnimationEndFunction · 0.90
handleOutAnimationEndFunction · 0.90

Calls 2

getEventTargetFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…