Skip to content

Commit

Permalink
end tour if all stops have been visited
Browse files Browse the repository at this point in the history
  • Loading branch information
jdan committed Jan 21, 2014
1 parent 9066340 commit fa8d372
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions www/js/tour.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ Tour.prototype.start = function () {
Tour.prototype.visit = function () {
this.stopIndex++;

if (this.stopIndex === this.stops.length) {
return this.end();
}

this.nextStop(this.stops[this.stopIndex].name);
// See if last stop has been hit

Expand Down

0 comments on commit fa8d372

Please sign in to comment.