fixed up map info box issues, finished up search tooltips

This commit is contained in:
Connor Turland 2014-11-23 22:28:29 -05:00
parent b077dd6010
commit e9114a309f
4 changed files with 18 additions and 18 deletions

View file

@ -4726,7 +4726,7 @@ Metamaps.Map.InfoBox = {
} }
$('.mapContributors img').attr('src', contributors_image).removeClass('multiple mTwo').addClass(contributors_class); $('.mapContributors img').attr('src', contributors_image).removeClass('multiple mTwo').addClass(contributors_class);
$('.mapContributors span').text(Metamaps.Mappers.length) $('.mapContributors span').text(Metamaps.Mappers.length)
$('.mapContributors .tip').text(self.createContributorList()); $('.mapContributors .tip').html(self.createContributorList());
$('.mapTopics').text(Metamaps.Topics.length); $('.mapTopics').text(Metamaps.Topics.length);
$('.mapSynapses').text(Metamaps.Synapses.length); $('.mapSynapses').text(Metamaps.Synapses.length);

View file

@ -488,7 +488,8 @@
} }
.sidebarSearch .topicOriginatorIcon .tip { .sidebarSearch .topicOriginatorIcon .tip {
margin-right: -120px; left: 30px;
right: auto;
top: 1px; top: 1px;
} }
.sidebarSearch .tip { .sidebarSearch .tip {
@ -511,7 +512,8 @@
} }
.sidebarSearch .mapContributorsIcon .tip { .sidebarSearch .mapContributorsIcon .tip {
margin-right: -120px; left: 40px;
right: auto;
top: -5px; top: -5px;
padding-top: 5px; padding-top: 5px;
padding-bottom: 5px; padding-bottom: 5px;
@ -539,6 +541,15 @@
border-bottom: 5px solid transparent; border-bottom: 5px solid transparent;
} }
.sidebarSearch .hoverForTip.addToMap .tip {
right: 30px;
}
.sidebarSearch .hoverForTip.addToMap .tip:before {
right: -4px;
border-left: 4px solid #424242;
border-right: none;
}
.sidebarSearch .mapContributorsIcon .tip:before { .sidebarSearch .mapContributorsIcon .tip:before {
top: 65px; top: 65px;
left: -4px; left: -4px;

View file

@ -13,24 +13,12 @@ module MapsHelper
map['topicCount'] = m.topics.count map['topicCount'] = m.topics.count
map['synapseCount'] = m.synapses.count map['synapseCount'] = m.synapses.count
map['contributorCount'] = m.contributors.count map['contributorCount'] = m.contributors.count
map[''] = m.contributors[0].image.url(:square)
map['rtype'] = "map" map['rtype'] = "map"
contributorList = m.user.name + ' created this map. '
if m.contributors.count > 0
m.contributors.each_with_index do |c, index|
comma = (index+1) == m.contributors.count ? '' : ', '
contributorList += c.name + comma
end
contributorList += ' has edited it.' if m.contributors.count == 1
contributorList += ' have edited it.' if m.contributors.count > 1
else
contributorList += 'No one has added anything yet.'
end
map['contributorList'] = contributorList
contributorTip = '' contributorTip = ''
firstContributorImage = '/assets/user.png'
if m.contributors.count > 0 if m.contributors.count > 0
firstContributorImage = m.contributors[0].image.url(:square)
m.contributors.each_with_index do |c, index| m.contributors.each_with_index do |c, index|
userImage = c.image.url(:square) userImage = c.image.url(:square)
name = c.name name = c.name
@ -38,6 +26,8 @@ module MapsHelper
end end
end end
map['contributorTip'] = contributorTip map['contributorTip'] = contributorTip
map['mapContributorImage'] = firstContributorImage
temp.push map temp.push map
end end
return temp return temp

View file

@ -18,7 +18,6 @@
<img id="mapContribs" width="25" height="25" src="<%= @map.contributors[0].image.url(:square) %>" /> <img id="mapContribs" width="25" height="25" src="<%= @map.contributors[0].image.url(:square) %>" />
<% elsif @map.contributors.count == 2 %> <% elsif @map.contributors.count == 2 %>
<img id="mapContribs" width="25" height="25" src="<%= @map.contributors[0].image.url(:square) %>" class="multiple mTwo" /> <img id="mapContribs" width="25" height="25" src="<%= @map.contributors[0].image.url(:square) %>" class="multiple mTwo" />
<div class="mapContribsDrop">
<% elsif @map.contributors.count > 2 %> <% elsif @map.contributors.count > 2 %>
<img id="mapContribs" width="25" height="25" src="<%= @map.contributors[0].image.url(:square) %>" class="multiple" /> <img id="mapContribs" width="25" height="25" src="<%= @map.contributors[0].image.url(:square) %>" class="multiple" />
<% end %> <% end %>