diff --git a/client/scripts/application.js b/client/scripts/application.js index 7941817..4d4b99d 100644 --- a/client/scripts/application.js +++ b/client/scripts/application.js @@ -35,7 +35,6 @@ function onReady(geo) { _ctx = { - log: [], geo: geo, query: {} }; @@ -102,7 +101,7 @@ } function saveSnapshot(results) { - _ctx.log.push(results); + window.history.pushState(results); } function outputSnapshot(results, omitValues) { @@ -138,6 +137,12 @@ } } + window.onpopstate = function(state) { + if (state.state) { + outputSnapshot(state.state, false); + } + }; + $(document).on({ ajaxStart: function() { $('#spinner').show();