Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#2613 closed defect (fixed)

dojo.html.Chain does not fire onEnd when play invoked with zero length animations

Reported by: chris.leishman@… Owned by: Bryan Forbes
Priority: high Milestone: 0.9beta
Component: lfx Version: 0.4.1
Keywords: Cc:
Blocked By: Blocking:

Description

The play() method of dojo.html.Chain directly returns if this._anims.length is zero:

<snip> dojo.lfx.Chain.play = function (delay, gotoStart) {

if( !this._anims.length ) { return this; /*dojo.lfx.Chain*/}

if( gotoStart
!this._anims[this._currAnim] ) {

this._currAnim = 0;

</snip>

In this case the onEnd handler for the chain itself is not invoked (this is usually invoked by the last sub-animation in the chain). Perhaps this should be as follows:

<snip> dojo.lfx.Chain.play = function (delay, gotoStart) {

if( !this._anims.length ) { this.fire("onEnd"); return this; /*dojo.lfx.Chain*/}

if( gotoStart
!this._anims[this._currAnim] ) {

this._currAnim = 0;

</snip>

Change History (3)

comment:1 Changed 13 years ago by Adam Peller

Component: Generallfx
Owner: changed from anonymous to Bryan Forbes

comment:2 Changed 12 years ago by Adam Peller

Resolution: fixed
Status: newclosed

currently, chain will return undefined if an empty array is passed in.

comment:3 Changed 12 years ago by Adam Peller

Milestone: 0.9beta
Note: See TracTickets for help on using tickets.