diff --git a/app/assets/javascripts/src/Metamaps.Router.js b/app/assets/javascripts/src/Metamaps.Router.js index 5c5d6879..6d9e2012 100644 --- a/app/assets/javascripts/src/Metamaps.Router.js +++ b/app/assets/javascripts/src/Metamaps.Router.js @@ -225,7 +225,6 @@ if (href.attr === "") Metamaps.Router.home(); else { - console.log(segments); Metamaps.Router[segments[0]](segments[1], segments[2]); } } diff --git a/app/assets/javascripts/src/Metamaps.Views.js b/app/assets/javascripts/src/Metamaps.Views.js index eab536ba..00f1b7f6 100644 --- a/app/assets/javascripts/src/Metamaps.Views.js +++ b/app/assets/javascripts/src/Metamaps.Views.js @@ -9,7 +9,7 @@ Metamaps.Views.init = function () { template: Hogan.compile( $('#mapperCardTemplate').html() ), - tagName: "div", + tagNamea: "div", className: "mapper", @@ -91,8 +91,10 @@ Metamaps.Views.init = function () { } Metamaps.Loading.hide(); - setTimeout(function(){ - var path = Metamaps.currentSection == "" ? "" : "/explore/" + Metamaps.currentPage; + + clearTimeout(Metamaps.routerTimeoutFunctionIds); + Metamaps.routerTimeoutId = setTimeout((function(localCurrentPage){ return function(){ + var path = (Metamaps.currentSection == "") ? "" : "/explore/" + localCurrentPage; // alter url if for mapper profile page if (that.collection && that.collection.mapperId) { @@ -100,7 +102,7 @@ Metamaps.Views.init = function () { } Metamaps.Router.navigate(path); - }, 500); + }})(Metamaps.currentPage), 500); }, handleSuccess: function () { var that = this; @@ -133,4 +135,4 @@ Metamaps.Views.init = function () { Metamaps.Views.exploreMaps = new mapsWrapper(); }; -})(); \ No newline at end of file +})(); diff --git a/app/assets/javascripts/src/Metamaps.js b/app/assets/javascripts/src/Metamaps.js index e27d6423..8faaeac7 100644 --- a/app/assets/javascripts/src/Metamaps.js +++ b/app/assets/javascripts/src/Metamaps.js @@ -4765,6 +4765,8 @@ Metamaps.Map.InfoBox = { $('.mapContributors .tip').unbind().click(function(event){ event.stopPropagation(); }); + $('.mapContributors .tip li a').click(Metamaps.Router.intercept); + $('.mapInfoBox').unbind('.hideTip').bind('click.hideTip', function(){ $('.mapContributors .tip').hide(); }); @@ -4778,15 +4780,15 @@ Metamaps.Map.InfoBox = { var self = Metamaps.Map.InfoBox; var string = ""; - + console.log("hello!!") string += "