animation-end.js 517 Bytes
Newer Older
eddie.woo's avatar
eddie.woo committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
commonModule.directive('animationEnd', function () {
    return {
        restrict: 'A',
        scope: {
            animationEnd: '&'
        },
        link: function(scope, element) {
            var events = 'animationend webkitAnimationEnd';

            element.on(events, function (event) {
                if (_.isFunction(scope.animationEnd)) {
                    scope.animationEnd({
                        '$event': event
                    });
                }
            });
        }
    };
});