diff --git a/js/angular/service/animation.js b/js/angular/service/animation.js index ae91468ba5..483f7ee0e3 100644 --- a/js/angular/service/animation.js +++ b/js/angular/service/animation.js @@ -1,3 +1,4 @@ + /** * @ngdoc service * @name $ionicAnimation @@ -45,14 +46,16 @@ * */ IonicModule -.factory('$ionicAnimation', [ - '$rootScope', - '$document', - '$compile', - '$timeout', - '$interval', -function($rootScope, $document, $compile, $timeout, $interval) { - return function(opts) { - return ionic.Animation.create(opts); - } -}]); +.provider('$ionicAnimation', function() { + var useSlowAnimations = false; + this.setSlowAnimations = function(isSlow) { + useSlowAnimations = isSlow; + }; + + this.$get = [function() { + return function(opts) { + opts.useSlowAnimations = useSlowAnimations; + return ionic.Animation.create(opts); + } + }] +}); diff --git a/js/animation/animation.js b/js/animation/animation.js index 192d6abb94..712521b486 100644 --- a/js/animation/animation.js +++ b/js/animation/animation.js @@ -71,6 +71,12 @@ */ ionic.Animation.Animation = function(opts) { ionic.extend(this, opts); + + if(opts.useSlowAnimations) { + console.warn('Running animation', opts.name, 'with SLOW animations (duration and delay increased by 3x)'); + this.delay *= 3; + this.duration *= 3; + } }; ionic.Animation.Animation.prototype = { diff --git a/test/html/animation.html b/test/html/animation.html index 2f3cd61ce8..20e622ac5f 100644 --- a/test/html/animation.html +++ b/test/html/animation.html @@ -50,6 +50,9 @@