diff --git a/app/assets/javascripts/src/Metamaps.Views.js b/app/assets/javascripts/src/Metamaps.Views.js index eab536ba..36fc0d2c 100644 --- a/app/assets/javascripts/src/Metamaps.Views.js +++ b/app/assets/javascripts/src/Metamaps.Views.js @@ -91,8 +91,14 @@ Metamaps.Views.init = function () { } Metamaps.Loading.hide(); - setTimeout(function(){ - var path = Metamaps.currentSection == "" ? "" : "/explore/" + Metamaps.currentPage; + + console.log("OK current page is " + Metamaps.currentPage); + console.log(Metamaps); + setTimeout((function(localCurrentPage){ return function(){ + console.log("YEAH current page is " + Metamaps.currentPage); + console.log("YEAH current page passed is " + localCurrentPage); + console.log(Metamaps); + var path = (Metamaps.currentSection == "") ? "" : "/explore/" + localCurrentPage; // alter url if for mapper profile page if (that.collection && that.collection.mapperId) { @@ -100,7 +106,7 @@ Metamaps.Views.init = function () { } Metamaps.Router.navigate(path); - }, 500); + }})(Metamaps.currentPage), 500); }, handleSuccess: function () { var that = this; @@ -133,4 +139,4 @@ Metamaps.Views.init = function () { Metamaps.Views.exploreMaps = new mapsWrapper(); }; -})(); \ No newline at end of file +})();