Skip to content

Instantly share code, notes, and snippets.

@merqlove
Created August 29, 2014 11:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save merqlove/cc03a5eb4d0f20d6fb73 to your computer and use it in GitHub Desktop.
Save merqlove/cc03a5eb4d0f20d6fb73 to your computer and use it in GitHub Desktop.
NgAnimate Mock in CoffeeScript
# Converted JS from http://mgcrea.github.io/angular-strap
angular.module('ngAnimate', [])
.factory('$$animateReflow', ['$window', '$timeout', ($window, $timeout) ->
requestAnimationFrame = $window.requestAnimationFrame ||
$window.webkitRequestAnimationFrame ||
(fn) ->
$timeout(fn, 10, false)
cancelAnimationFrame = $window.cancelAnimationFrame ||
$window.webkitCancelAnimationFrame ||
(timer) ->
$timeout.cancel(timer)
(fn) ->
id = requestAnimationFrame(fn)
() ->
cancelAnimationFrame(id)
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment