use lambda to store currentPage so explore/mine doesn't get rendered incorrectly in url as explore/<mapid>

This commit is contained in:
Devin Howard 2014-11-29 15:23:53 -05:00
parent f938ffade3
commit 453758a9ff

View file

@ -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();
};
})();
})();