backbone.statemachine.js
function(data, event) {
        var extraArgs = _.toArray(arguments).slice(2),
        leaveState = this.currentState,
        enterState = data.enterState,
        triggers = data.triggers

        if (!this.silent)
          this.trigger.apply(this, ['leaveState:' + leaveState].concat(extraArgs))
        this._callCallbacks(this._states[leaveState].leave, extraArgs)

        if (!this.silent) {
          this.trigger.apply(this, ['transition', leaveState, enterState].concat(extraArgs))
          if (triggers)
            this.trigger.apply(this, [triggers].concat(extraArgs))
        }

        this._callCallbacks(data.callbacks, extraArgs)
        if (!this.silent)
          this.trigger.apply(this, ['enterState:' + enterState].concat(extraArgs))

        this.toState.apply(this, [enterState].concat(extraArgs))
      }
function(data, event) {
        var extraArgs = _.toArray(arguments).slice(2),
        leaveState = this.currentState,
        enterState = data.enterState,
        triggers = data.triggers

        if (!this.silent)
          this.trigger.apply(this, ['leaveState:' + leaveState].concat(extraArgs))
        this._callCallbacks(this._states[leaveState].leave, extraArgs)

        if (!this.silent) {
          this.trigger.apply(this, ['transition', leaveState, enterState].concat(extraArgs))
          if (triggers)
            this.trigger.apply(this, [triggers].concat(extraArgs))
        }

        this._callCallbacks(data.callbacks, extraArgs)
        if (!this.silent)
          this.trigger.apply(this, ['enterState:' + enterState].concat(extraArgs))

        this.toState.apply(this, [enterState].concat(extraArgs))
      }
function ( data , event ) { var extraArgs = _ . toArray ( arguments ) . slice ( 2 ) , leaveState = this . currentState , enterState = data . enterState , triggers = data . triggers if ( ! this . silent ) this . trigger . apply ( this , [ 'leaveState:' + leaveState ] . concat ( extraArgs ) ) this . _callCallbacks ( this . _states [ leaveState ] . leave , extraArgs ) if ( ! this . silent ) { this . trigger . apply ( this , [ 'transition' , leaveState , enterState ] . concat ( extraArgs ) ) if ( triggers ) this . trigger . apply ( this , [ triggers ] . concat ( extraArgs ) ) } this . _callCallbacks ( data . callbacks , extraArgs ) if ( ! this . silent ) this . trigger . apply ( this , [ 'enterState:' + enterState ] . concat ( extraArgs ) ) this . toState . apply ( this , [ enterState ] . concat ( extraArgs ) ) }
Executes a transition.
Executes a transition .