diff --git a/app/assets/javascripts/src/Metamaps.Router.js b/app/assets/javascripts/src/Metamaps.Router.js index fae8f38e..2afcbf95 100644 --- a/app/assets/javascripts/src/Metamaps.Router.js +++ b/app/assets/javascripts/src/Metamaps.Router.js @@ -194,34 +194,38 @@ Metamaps.Router = new Router(); + + Metamaps.Router.intercept = function (evt) { + var segments; + + var href = { + prop: $(this).prop("href"), + attr: $(this).attr("href") + }; + var root = location.protocol + "//" + location.host + Backbone.history.options.root; + + if (href.prop && href.prop === root) href.attr = ""; + + if (href.prop && href.prop.slice(0, root.length) === root) { + evt.preventDefault(); + + segments = href.attr.split('/'); + segments.splice(0,1); // pop off the element created by the first / + + if (href.attr === "") Metamaps.Router.home(); + else { + console.log(segments); + Metamaps.Router[segments[0]](segments[1]); + } + } + }; + Metamaps.Router.init = function () { Backbone.history.start({ silent: true, pushState: true, root: '/' }); - $(document).on("click", "a:not([data-bypass])", function (evt) { - var segments; - - var href = { - prop: $(this).prop("href"), - attr: $(this).attr("href") - }; - var root = location.protocol + "//" + location.host + Backbone.history.options.root; - - if (href.prop && href.prop === root) href.attr = "" - - if (href.prop && href.prop.slice(0, root.length) === root) { - evt.preventDefault(); - - segments = href.attr.split('/'); - segments.splice(0,1); // pop off the element created by the first / - - if (href.attr === "") Metamaps.Router.home(); - else { - Metamaps.Router[segments[0]](segments[1]); - } - } - }); - } + $(document).on("click", "a:not([data-bypass])", Metamaps.Router.intercept); + }; })(); diff --git a/app/assets/javascripts/src/Metamaps.js b/app/assets/javascripts/src/Metamaps.js index a907df8f..929e8a3f 100644 --- a/app/assets/javascripts/src/Metamaps.js +++ b/app/assets/javascripts/src/Metamaps.js @@ -1092,7 +1092,7 @@ Metamaps.TopicCard = { $('.links .mapCount').unbind().click(function(event){ $('.mapCount .tip').toggle(); - $('.hoverTip').toggleClass('hide'); + $('.showcard .hoverTip').toggleClass('hide'); event.stopPropagation(); }); $('.mapCount .tip').unbind().click(function(event){ @@ -1100,8 +1100,11 @@ Metamaps.TopicCard = { }); $('.showcard').unbind('.hideTip').bind('click.hideTip', function(){ $('.mapCount .tip').hide(); + $('.showcard .hoverTip').removeClass('hide'); }); + $('.mapCount .tip li a').click(Metamaps.Router.intercept); + var originalText = $('.showMore').html(); $('.mapCount .tip .showMore').unbind().toggle( function(event){ diff --git a/app/assets/stylesheets/base.css b/app/assets/stylesheets/base.css index 5b0f3439..b924e7a4 100644 --- a/app/assets/stylesheets/base.css +++ b/app/assets/stylesheets/base.css @@ -312,6 +312,7 @@ .showMore { cursor: pointer; + color: #4FC059; } .mapCount .tip a { diff --git a/app/assets/stylesheets/clean.css b/app/assets/stylesheets/clean.css index bca46825..b2b3e974 100644 --- a/app/assets/stylesheets/clean.css +++ b/app/assets/stylesheets/clean.css @@ -798,7 +798,7 @@ background-color: #4fb5c0; } .callToAction .learnMoreCTA:hover { - background-color: #3d8e8e; + background-color: #419599; } .fullWidthWrapper.withPartners { diff --git a/app/views/layouts/_templates.html.erb b/app/views/layouts/_templates.html.erb index ef8ea19b..820feb09 100644 --- a/app/views/layouts/_templates.html.erb +++ b/app/views/layouts/_templates.html.erb @@ -129,7 +129,7 @@