Skip to content

Commit

Permalink
added ability to clone markers from previous state
Browse files Browse the repository at this point in the history
  • Loading branch information
jdan committed Jan 16, 2014
1 parent 53e1618 commit 5dfb560
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions www/js/state.js
Expand Up @@ -35,6 +35,10 @@ State.BACK_BUTTON = document.querySelector('#navigation .back');
State.prototype.push = function (elem) {
if (!elem) return;

if (elem.cloneMarkers) {
elem.markers = this.current().markers;
}

this.stack.push(elem);
return this.render();
};
Expand Down
6 changes: 5 additions & 1 deletion www/js/tour.js
Expand Up @@ -20,7 +20,11 @@ Tour.prototype.start = function () {

this.isRunning = true;
Tour.CONTROL_VIEW.classList.remove('hidden');
this.state.push({ view: '', navigationText: 'End Tour' });
this.state.push({
view: '',
navigationText: 'End Tour',
cloneMarkers: true
});
};

Tour.prototype.visit = function () {
Expand Down

0 comments on commit 5dfb560

Please sign in to comment.