Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't show the layer config button if the layer is not activated #4875

Merged
merged 4 commits into from
Jul 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions contribs/gmf/src/layertree/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,14 @@
border: 0.06rem solid $main-bg-color;
background-color: lighten($main-bg-color, 8%);

.off {
opacity: 0.5;
display: none;
&.show {
// legend is displayed
display: block;
&.off {
// legend is displayed but the layer is not visible
display: none;
}
}

a {
Expand Down
5 changes: 1 addition & 4 deletions contribs/gmf/src/layertree/component.html
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@
<i class="fa fa-th-list fa-fw"></i>
<a
ng-click="::gmfLayertreeCtrl.toggleNodeLegend('#gmf-layertree-node-' + layertreeCtrl.uid + '-legend'); popoverCtrl.dismissPopover()"
data-toggle="collapse"
href="">
{{'Show/hide legend'|translate}}
</a>
Expand Down Expand Up @@ -222,7 +221,6 @@
<a
class="gmf-layertree-node-menu-togglelegend"
ng-if="::gmfLayertreeCtrl.supportsLegend(layertreeCtrl)"
data-toggle="collapse"
ng-click="::gmfLayertreeCtrl.toggleNodeLegend('#gmf-layertree-node-' + layertreeCtrl.uid + '-legend')"
href="">
<span
Expand All @@ -235,12 +233,11 @@

<div
ng-if="::!layertreeCtrl.isRoot && gmfLayertreeCtrl.getLegendsObject(layertreeCtrl) && layertreeCtrl.node.metadata.legend" id="gmf-layertree-node-{{::layertreeCtrl.uid}}-legend"
class="collapse gmf-layertree-legend"
class="gmf-layertree-legend"
ng-class="[gmfLayertreeCtrl.getNodeState(layertreeCtrl), layertreeCtrl.node.metadata.isLegendExpanded ? 'show' : '']">

<a
title="{{'Hide legend'|translate}}"
data-toggle="collapse"
ng-click="::gmfLayertreeCtrl.toggleNodeLegend('#gmf-layertree-node-' + layertreeCtrl.uid + '-legend')"
href="">
{{'Hide legend'|translate}}
Expand Down
7 changes: 4 additions & 3 deletions contribs/gmf/src/layertree/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -807,9 +807,10 @@ Controller.prototype.zoomToResolution = function(treeCtrl) {
* @param {string} legendNodeId The DOM node legend id to toggle
*/
Controller.prototype.toggleNodeLegend = function(legendNodeId) {
$(legendNodeId).toggle({
toggle: true
});
const div = document.querySelector(legendNodeId);
if (div) {
div.classList.toggle('show');
}
};


Expand Down
14 changes: 10 additions & 4 deletions contribs/gmf/src/layertree/desktop.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,16 @@ gmf-layertree {
padding: $half-app-margin;
}

.gmf-layertree-group:hover,
.gmf-layertree-leaf:hover {
.gmf-layertree-right-buttons {
display: block;
.gmf-layertree-group, .gmf-layertree-leaf {
&:hover {
.gmf-layertree-right-buttons {
display: block;
}
}
&.off {
.extra-actions {
display: none;
}
}
}

Expand Down
8 changes: 4 additions & 4 deletions contribs/gmf/src/search/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -696,10 +696,10 @@ class SearchController {
*/
filterAction_(action) {
return (
/**
* @param {import("geojson").Feature} feature
* @return {boolean}
*/
/**
* @param {import("geojson").Feature} feature
* @return {boolean}
*/
function(feature) {
const properties = feature.properties || {};
if (properties.actions) {
Expand Down