Skip to content

Commit

Permalink
#6 - Info layer on map should be open by default - Info on images bug…
Browse files Browse the repository at this point in the history
… fix (was not showing any text and should be closed by default)
  • Loading branch information
eamador committed Apr 19, 2017
1 parent b3dd9b7 commit e6fdc14
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 25 deletions.
1 change: 1 addition & 0 deletions src/css/shared/elements/info/styles.less
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ info {
.allMapLayers {
max-height: 92%;
overflow-y: auto;
width: 350px;
.mapLayerWrapper {
width: 320px;
&:not(:last-child) {
Expand Down
1 change: 1 addition & 0 deletions src/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -4638,6 +4638,7 @@ info > .component-container .info.hidden {
info > .component-container .allMapLayers {
max-height: 92%;
overflow-y: auto;
width: 350px;
}
info > .component-container .allMapLayers .mapLayerWrapper {
width: 320px;
Expand Down
12 changes: 2 additions & 10 deletions src/shared/steps/map/MapStep.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/shared/steps/map/MapStep.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 1 addition & 10 deletions src/shared/steps/map/MapStep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,7 @@ export class MapStepComponent extends BaseStepComponent {
});
this.mapService.map.scrollZoom.disable();

this.setActiveLayer();
}

setActiveLayer() {
for (let layer in this.step.info) {
if (this.step.info[layer].collapsed === false) {
this.activeLayer = this.step.info[layer];
break;
}
}
this.activeLayer = this.step.info[0];
this.mapService.map.on('load', () => {
this.updateLayers(this.activeLayer);
});
Expand Down
8 changes: 4 additions & 4 deletions src/templates/shared/elements/info/view.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
</div>
</div>

<div class="component-container">
<div class="allMapLayers" *ngIf="item.length > 1">
<div class="component-container" (click)="toggleVisibility()">
<div class="allMapLayers" *ngIf="item.length > 1" (click)="$event.stopPropagation()">
<div class="mapLayerWrapper" *ngFor="let info of item|| []; let i=index">
<div class="titleWrapper">
<div
Expand All @@ -35,12 +35,12 @@
<div class="credit" [ngClass]="{hidden: info.collapsed === true}">{{info.credit}}</div>
</div>
</div>
<div *ngIf="item.length === 1">
<div *ngIf="!item.length" (click)="$event.stopPropagation()">
<div class="title" (click)="toggleLayer(item)">{{item.title}}</div>
<div class="info" [ngClass]="{hidden: item.collapsed === true}">
<element-block [elements]="item.elements"></element-block>
</div>
<div class="credit">
<div class="credit" [ngClass]="{hidden: item.collapsed === true}">
{{item.credit}}
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/templates/shared/steps/map/view.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<info
*ngIf="hasInfo()"
[item]="step.info"
[collapsed]="false"
(manageLayers)="updateLayers($event)"
(downloadShp)="getShpFile($event)"
></info>
Expand Down

0 comments on commit e6fdc14

Please sign in to comment.