Skip to content
Browse files

Optional init parameter for the statemachine.

  • Loading branch information...
1 parent 94f7d93 commit 5e57bdc521f904b3836c973a1dc2f1043624f8f4 @jverkoey committed Mar 2, 2010
Showing with 4 additions and 4 deletions.
  1. +4 −4 dev/core/class.statemachine.js
View
8 dev/core/class.statemachine.js
@@ -113,18 +113,18 @@ Breeze.StateMachine.prototype.attachNotifier = function(notifier) {
};
/**
- * @param {number} startState
- * @param {number} queuedState
+ * @param {number} startState
+ * @param {number=} opt_queuedState
*/
-Breeze.StateMachine.prototype.init = function(startState, queuedState) {
+Breeze.StateMachine.prototype.init = function(startState, opt_queuedState) {
this.curr_ = Breeze.StateMachine.ReservedIDs.InvalidID;
this.queued_ = Breeze.StateMachine.ReservedIDs.InvalidID;
this.isTransitioning_ = false;
this.transitionTo_ = Breeze.StateMachine.ReservedIDs.InvalidID;
this.transitionToQueue_ = Breeze.StateMachine.ReservedIDs.InvalidID;
this.timer_.reset();
- this.queueStateChange(startState, queuedState);
+ this.queueStateChange(startState, opt_queuedState || Breeze.StateMachine.ReservedIDs.InvalidID);
};
/**

0 comments on commit 5e57bdc

Please sign in to comment.
Something went wrong with that request. Please try again.