index.js
function () {
			var localNodes = sequence.nodes;
			var localIndex = (localNodes) ? localNodes.indexOf(node) : null;

			// Delete any variation forks at this point
			// TODO: Make this configurable... we should keep this if we're
			// remembering chosen paths
			delete this.path[this.path.m];

			if (!localIndex || localIndex === 0) {
				if (sequence.parent && !sequence.parent.gameTrees) {
					sequence = sequence.parent;
					if (sequence.nodes) {
						node = sequence.nodes[sequence.nodes.length - 1];
						this.path.m -= 1;
					} else {
						node = null;
					}
				} else {
					// Already at the beginning
					return this;
				}
			} else {
				node = localNodes[localIndex - 1];
				this.path.m -= 1;
			}

			return this;
		}
function () {
			var localNodes = sequence.nodes;
			var localIndex = (localNodes) ? localNodes.indexOf(node) : null;

			// Delete any variation forks at this point
			// TODO: Make this configurable... we should keep this if we're
			// remembering chosen paths
			delete this.path[this.path.m];

			if (!localIndex || localIndex === 0) {
				if (sequence.parent && !sequence.parent.gameTrees) {
					sequence = sequence.parent;
					if (sequence.nodes) {
						node = sequence.nodes[sequence.nodes.length - 1];
						this.path.m -= 1;
					} else {
						node = null;
					}
				} else {
					// Already at the beginning
					return this;
				}
			} else {
				node = localNodes[localIndex - 1];
				this.path.m -= 1;
			}

			return this;
		}
function ( ) { var localNodes = sequence . nodes ; var localIndex = ( localNodes ) ? localNodes . indexOf ( node ) : null ; // Delete any variation forks at this point // TODO: Make this configurable... we should keep this if we're // remembering chosen paths delete this . path [ this . path . m ] ; if ( ! localIndex || localIndex === 0 ) { if ( sequence . parent && ! sequence . parent . gameTrees ) { sequence = sequence . parent ; if ( sequence . nodes ) { node = sequence . nodes [ sequence . nodes . length - 1 ] ; this . path . m -= 1 ; } else { node = null ; } } else { // Already at the beginning return this ; } } else { node = localNodes [ localIndex - 1 ] ; this . path . m -= 1 ; } return this ; }
Go to the previous move
Go to the previous move