Permalink
Browse files

Fixes #528 - The wait method of Chain.Wait should return a truthy val…

…ue so Fx:stop will not call the chainComplete event already
  • Loading branch information...
1 parent 6b0274e commit 96ac2b4e5ed41af91ad6694c6d31c50c4b0704e7 @arian arian committed with anutron Mar 13, 2011
Showing with 19 additions and 0 deletions.
  1. +1 −0 Source/Class/Chain.Wait.js
  2. +18 −0 Specs/1.3/Class/Chain.Wait.js
@@ -29,6 +29,7 @@ provides: [Chain.Wait]
wait: function(duration){
return this.chain(function(){
this.callChain.delay(duration == null ? 500 : duration, this);
+ return this;
}.bind(this));
}
};
@@ -47,4 +47,22 @@ describe('Chain.Wait', function(){
});
+ it('should not break the chainComplete event in Fx', function(){
+ var count = 0;
+ new Fx({
+ link: 'chain',
+ onChainComplete: function(){
+ count++;
+ },
+ duration: 50
+ }).start(0, 1).wait(40).start(1, 0);
+
+ waits(500);
+
+ runs(function(){
+ expect(count).toEqual(1);
+ });
+
+ });
+
});

0 comments on commit 96ac2b4

Please sign in to comment.