Your IP : 216.73.216.86


Current Path : /var/www/homesaver/www/bitrix/js/landing/main/src/internal/
Upload File :
Current File : /var/www/homesaver/www/bitrix/js/landing/main/src/internal/on-animation-end.js

import {Event} from 'main.core';

export default function onAnimationEnd(element: HTMLElement, animationName: string)
{
	return new Promise(((resolve) => {
		const onAnimationEndListener = (event) => {
			if (!animationName || (event.animationName === animationName))
			{
				resolve(event);
				Event.bind(element, 'animationend', onAnimationEndListener);
			}
		};

		Event.bind(element, 'animationend', onAnimationEndListener);
	}));
}