Skip to content

Commit

Permalink
Merge pull request #2984 from Vizzuality/feature/fix-legend-style-errors
Browse files Browse the repository at this point in the history
Fix message and tooltip
  • Loading branch information
pjosh committed Jul 20, 2017
2 parents af03ef2 + 6a477f1 commit 8cdd409
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Expand Up @@ -111,7 +111,7 @@
<use data-slug-show="{{this.slug}}" xlink:href="#icon-hide-layer-map"></use>
</svg>
</div>
{{this.title}}
{{this.title}}
{{#if this.allowSubscription}}
<a href="/my_gfw/subscriptions/new?datasets={{this.slug}}" class="alerts" title="Receive forest loss alerts"><svg><use xlink:href="#icon-mail-legend"></use></svg></a>
{{/if}}
Expand Down
6 changes: 5 additions & 1 deletion app/assets/javascripts/map/views/LegendView.js
Expand Up @@ -264,6 +264,9 @@ define([
_.each(layers, function(layer) {
layer.source = (layer.slug === 'nothing') ? null : layer.source || layer.slug;
if (this.detailsTemplates[layer.slug]) {
if (layer.title === 'Tree plantations by type' || layer.title === 'Tree plantations by species') {
layer.title = 'Tree plantations'
}
layer.detailsTpl = this.detailsTemplates[layer.slug]({
threshold: options.threshold || 30,
hresolution: options.hresolution,
Expand Down Expand Up @@ -322,7 +325,7 @@ define([
return _.groupBy(filteredLayers, function(layer) {
layer.allowSubscription = layer && subscriptionsAllowed.indexOf(layer.slug) > -1;

// Hack to keep the forest_clearing slug in layers which have to be analyzed but not grouped by the said slug in the legend
// Hack to keep the forest_clearing slug in layers which have to be analyzed but not grouped by the said slug in the legend
if (layer.category_slug === 'forest_clearing' && !layer.is_forest_clearing) return 'forest_cover';
return layer.category_slug;
})
Expand Down Expand Up @@ -466,6 +469,7 @@ define([
var top = position.top - 10;
var left = position.left - 92;
var text = $(e.target).attr('data-description');
var dataSource = $(e.target).attr('data-source');
if (text != '') {
$('body').append('<div class="tooltip-info-legend" id="tooltip-info-legend" style="top:'+top+'px; left:'+left+'px;"><div class="triangle"><span>'+text+'</span><p>Click to see more</p></div></div>');
}
Expand Down
2 changes: 2 additions & 0 deletions app/assets/stylesheets/layouts/_embed-map.scss
Expand Up @@ -284,6 +284,8 @@
position: absolute;
z-index: 1000;
max-width: 200px;
min-width: 200px;
width: 200px;
padding: 8px;
background-color: #fffee2;
box-shadow: 0 1px 3px 0 rgba(85, 85, 85, .25);
Expand Down

0 comments on commit 8cdd409

Please sign in to comment.