diff --git a/app/assets/javascripts/src/Metamaps.js b/app/assets/javascripts/src/Metamaps.js index 09e3e27a..0daf6b97 100644 --- a/app/assets/javascripts/src/Metamaps.js +++ b/app/assets/javascripts/src/Metamaps.js @@ -1092,14 +1092,16 @@ Metamaps.TopicCard = { $('.links .mapCount').unbind().click(function(event){ $('.mapCount .tip').toggle(); + $('.hoverTip').toggleClass('hide'); event.stopPropagation(); }); $('.mapCount .tip').unbind().click(function(event){ event.stopPropagation(); }); - $('.showCard').unbind('.hideTip').bind('click.hideTip', function(){ + $('.showcard').unbind('.hideTip').bind('click.hideTip', function(){ $('.mapCount .tip').hide(); }); + var originalText = $('.showMore').html(); $('.mapCount .tip .showMore').unbind().toggle( function(event){ @@ -1187,22 +1189,25 @@ Metamaps.TopicCard = { nodeValues.attachments = ''; } - console.log(topic.get("inmaps")); var inmapsAr = topic.get("inmaps"); + var inmapsLinks = topic.get("inmapsLinks"); nodeValues.inmaps =''; if (inmapsAr.length < 6) { for (i = 0; i < inmapsAr.length; i++) { - nodeValues.inmaps += '
  • ' + inmapsAr[i] + '
  • '; + var url = "/maps/" + inmapsLinks[i]; + nodeValues.inmaps += '
  • ' + inmapsAr[i]+ '
  • '; } } else { for (i = 0; i < 5; i++){ - nodeValues.inmaps += '
  • ' + inmapsAr[i] + '
  • '; + var url = "/maps/" + inmapsLinks[i]; + nodeValues.inmaps += '
  • ' + inmapsAr[i] + '
  • '; } extra = inmapsAr.length - 5; nodeValues.inmaps += '
  • See ' + extra + ' more...
  • ' for (i = 5; i < inmapsAr.length; i++){ - nodeValues.inmaps += '
  • ' + inmapsAr[i] + '
  • '; + var url = "/maps/" + inmapsLinks[i]; + nodeValues.inmaps += '
  • ' + inmapsAr[i]+ '
  • '; } } nodeValues.permission = topic.get("permission"); diff --git a/app/assets/stylesheets/base.css b/app/assets/stylesheets/base.css index 9965d851..c30f88d3 100644 --- a/app/assets/stylesheets/base.css +++ b/app/assets/stylesheets/base.css @@ -247,18 +247,39 @@ background-image: url(map32_sprite.png); background-repeat: no-repeat; background-position: 0 0; + cursor: pointer; } .linkItem.mapCount:hover .mapCountIcon { background-position: 0 -32px; } -.CardOnGraph .mapCount .tip { +.linkItem.mapCount:hover .hoverTip { + display: block; +} +.CardOnGraph .mapCount .tip, .CardonGraph .mapCount .hoverTip { top: 44px; left: 0px; font-size: 12px !important; } -.CardOnGraph .mapCount .tip:before { +.hoverTip { + white-space: nowrap; + font-family: 'din-regular'; + top: 44px; + left: 0px; + font-size: 12px !important; + display: none; + position: absolute; + background: black; + color: white; + border-radius: 4px; + line-height: 17px; + padding: 3px 5px 2px; + z-index: 100; +} + + +.CardOnGraph .mapCount .tip:before, .CardOnGraph .mapCount .hoverTip:before { content: ''; position: absolute; top: 26px; @@ -293,6 +314,14 @@ cursor: pointer; } +.mapCount .tip a { + color: white; +} + +.mapCount .tip a:hover { + color: #757575; +} + .linkItem.synapseCount { margin-left: 2px; @@ -315,9 +344,9 @@ .CardOnGraph .synapseCount .tip { position: absolute; - background: #424242; + background: black; width: auto; - top: 45px; + top: 44px; color: white; white-space: nowrap; border-radius: 2px; @@ -339,7 +368,7 @@ margin-left: 6px; width: 0; height: 0; - border-bottom: 4px solid #424242; + border-bottom: 4px solid black; border-left: 5px solid transparent; border-right: 5px solid transparent; } diff --git a/app/helpers/topics_helper.rb b/app/helpers/topics_helper.rb index e75a7397..482a663c 100644 --- a/app/helpers/topics_helper.rb +++ b/app/helpers/topics_helper.rb @@ -18,6 +18,7 @@ module TopicsHelper topic['originatorImage'] = t.user.image.url(:thirtytwo) topic['rtype'] = "topic" topic['inmaps'] = t.inmaps + topic['inmapsLinks'] = t.inmapsLinks temp.push topic end diff --git a/app/models/topic.rb b/app/models/topic.rb index a9111f51..4d9cd527 100644 --- a/app/models/topic.rb +++ b/app/models/topic.rb @@ -58,8 +58,12 @@ class Topic < ActiveRecord::Base self.maps.map(&:name) end + def inmapsLinks + self.maps.map(&:id) + end + def as_json(options={}) - super(:methods =>[:user_name, :user_image, :map_count, :synapse_count, :inmaps]) + super(:methods =>[:user_name, :user_image, :map_count, :synapse_count, :inmaps, :inmapsLinks]) end def topic_autocomplete_method diff --git a/app/views/layouts/_templates.html.erb b/app/views/layouts/_templates.html.erb index 7cbb6c8d..d159c855 100644 --- a/app/views/layouts/_templates.html.erb +++ b/app/views/layouts/_templates.html.erb @@ -237,9 +237,10 @@
    {{username}}
    -
    +
    {{map_count}} +
    Click to see which maps topic appears on
      {{{inmaps}}}