From ee2f3d21da6c9fccfe1e6a4ea8a65627519c8bf2 Mon Sep 17 00:00:00 2001 From: Matias Niemelä Date: Wed, 21 Aug 2013 15:03:41 -0400 Subject: fix($animate): only execute a timeout when transitions or keyframe animations are used ngAnimate causes a 1ms flicker on the screen when no CSS animations are present on the element. The solution is to change $animate to only use $timeouts when a duration is found on the element before the transition/keyframe animation takes over. Closes #3613 --- docs/component-spec/annotationsSpec.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'docs') diff --git a/docs/component-spec/annotationsSpec.js b/docs/component-spec/annotationsSpec.js index d84bd5bd..f1acd64e 100644 --- a/docs/component-spec/annotationsSpec.js +++ b/docs/component-spec/annotationsSpec.js @@ -118,14 +118,12 @@ describe('Docs Annotations', function() { expect(foldout.html()).toContain('loading'); })); - it('should download a foldout HTML page and animate the contents', inject(function($httpBackend, $timeout) { + it('should download a foldout HTML page and animate the contents', inject(function($httpBackend, $timeout, $sniffer) { $httpBackend.expect('GET', url).respond('hello'); element.triggerHandler('click'); $httpBackend.flush(); - $timeout.flushNext(0); - $timeout.flushNext(1); $timeout.flushNext(0); $timeout.flushNext(1000); @@ -134,27 +132,22 @@ describe('Docs Annotations', function() { expect(foldout.text()).toContain('hello'); })); - it('should hide then show when clicked again', inject(function($httpBackend, $timeout) { + it('should hide then show when clicked again', inject(function($httpBackend, $timeout, $sniffer) { $httpBackend.expect('GET', url).respond('hello'); //enter element.triggerHandler('click'); $httpBackend.flush(); $timeout.flushNext(0); - $timeout.flushNext(1); - $timeout.flushNext(0); $timeout.flushNext(1000); //hide element.triggerHandler('click'); - $timeout.flushNext(1); $timeout.flushNext(0); $timeout.flushNext(200); - $timeout.flushNext(0); //show element.triggerHandler('click'); - $timeout.flushNext(1); $timeout.flushNext(0); $timeout.flushNext(500); $timeout.flushNext(0); -- cgit v1.2.3