-
-
Save z3bbster/4316e952bbedac747b1a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Invoke a CSS animation on `this` angular.element instance. | |
* @param className classname of animation to invoke on `this` element | |
* @param delay delay before animation is invoked | |
* @param done callback | |
*/ | |
angular.element.prototype.doAnim = function(className, delay, done, doneDelay) { | |
done = (typeof delay === 'function') ? delay : done; | |
$timeout(function() { | |
this.removeClass(className); | |
$timeout(function() { | |
this.addClass(className); | |
$timeout(done, doneDelay || 0); | |
}.bind(this), 100); | |
}.bind(this), delay || 0); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment