From 453758a9ffdc7048b4a6e1b01676ae1d3bc52342 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Sat, 29 Nov 2014 15:23:53 -0500 Subject: [PATCH 1/5] use lambda to store currentPage so explore/mine doesn't get rendered incorrectly in url as explore/ --- app/assets/javascripts/src/Metamaps.Views.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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 +})(); From 5f347bff6785fe49444c4b8534312c12a5c4093d Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Sat, 29 Nov 2014 15:24:34 -0500 Subject: [PATCH 2/5] remove console.logs whoops --- app/assets/javascripts/src/Metamaps.Views.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/assets/javascripts/src/Metamaps.Views.js b/app/assets/javascripts/src/Metamaps.Views.js index 36fc0d2c..b56a599f 100644 --- a/app/assets/javascripts/src/Metamaps.Views.js +++ b/app/assets/javascripts/src/Metamaps.Views.js @@ -92,12 +92,7 @@ Metamaps.Views.init = function () { Metamaps.Loading.hide(); - 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 From fe3d2808621ffe79bb342fd1d6ac5ea6f5753cb9 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Sat, 29 Nov 2014 15:29:16 -0500 Subject: [PATCH 3/5] remove console.log from Connor --- app/assets/javascripts/src/Metamaps.Router.js | 1 - 1 file changed, 1 deletion(-) 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]); } } From 739eba71bb0ced9d6d97c1d2b00ec00fd8c0e161 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Sat, 29 Nov 2014 15:51:31 -0500 Subject: [PATCH 4/5] only one router setTimeout function at a time - make it erase old functions if new one --- app/assets/javascripts/src/Metamaps.Views.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/src/Metamaps.Views.js b/app/assets/javascripts/src/Metamaps.Views.js index b56a599f..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", @@ -92,7 +92,8 @@ Metamaps.Views.init = function () { Metamaps.Loading.hide(); - setTimeout((function(localCurrentPage){ return function(){ + clearTimeout(Metamaps.routerTimeoutFunctionIds); + Metamaps.routerTimeoutId = setTimeout((function(localCurrentPage){ return function(){ var path = (Metamaps.currentSection == "") ? "" : "/explore/" + localCurrentPage; // alter url if for mapper profile page From ce3ab9903a4fe9a2debeaf6c85afc45fcfcbb353 Mon Sep 17 00:00:00 2001 From: Bashar Jabbour Date: Sat, 29 Nov 2014 15:56:38 -0500 Subject: [PATCH 5/5] make map contributor list dropdown into links to profiles --- app/assets/javascripts/src/Metamaps.js | 8 +++++--- app/assets/stylesheets/application.css | 3 +++ app/views/maps/_mapinfobox.html.erb | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/src/Metamaps.js b/app/assets/javascripts/src/Metamaps.js index 5bce8987..6acdb68c 100644 --- a/app/assets/javascripts/src/Metamaps.js +++ b/app/assets/javascripts/src/Metamaps.js @@ -4781,6 +4781,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(); }); @@ -4794,15 +4796,15 @@ Metamaps.Map.InfoBox = { var self = Metamaps.Map.InfoBox; var string = ""; - + console.log("hello!!") string += "
    "; Metamaps.Mappers.each(function(m){ - string += '
  • ' + m.get("name") + '
  • '; + string += '
  • ' + '' + m.get("name") + '
  • '; }); string += "
"; - + console.log(string); return string; }, updateNumbers: function () { diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 14904971..f3b855fa 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -1708,6 +1708,9 @@ h3.realtimeBoxTitle { color: white; } +.mapContributors .tip li a { + color: white; +} .mapContributors div:after { content: ''; position: absolute; diff --git a/app/views/maps/_mapinfobox.html.erb b/app/views/maps/_mapinfobox.html.erb index c6b3b3c9..4305b3a7 100644 --- a/app/views/maps/_mapinfobox.html.erb +++ b/app/views/maps/_mapinfobox.html.erb @@ -23,8 +23,8 @@ <% end %> <%= @map.contributors.count %>
    <% @map.contributors.each_with_index do |c, index| %> -
  • - <%= c.name %> +
  • + <%= c.name %>
  • <% end %>