From 5dfb56065fbdf979bf2e29e863f8bc69769411c6 Mon Sep 17 00:00:00 2001 From: Jordan Scales Date: Thu, 16 Jan 2014 00:37:07 -0500 Subject: [PATCH] added ability to clone markers from previous state --- www/js/state.js | 4 ++++ www/js/tour.js | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/www/js/state.js b/www/js/state.js index e2fc01c..350d36e 100644 --- a/www/js/state.js +++ b/www/js/state.js @@ -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(); }; diff --git a/www/js/tour.js b/www/js/tour.js index cb3e2a0..813a139 100644 --- a/www/js/tour.js +++ b/www/js/tour.js @@ -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 () {