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

perf(integration): add click action on igo-panel-title to show location details #1148

Merged
merged 5 commits into from
Jan 17, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/common/src/lib/panel/panel.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div *ngIf="withHeader" class="igo-panel-header mat-typography" title="">
<div *ngIf="withHeader" class="igo-panel-header mat-typography" title="" [ngClass]="{'igo-cursor-pointer': cursorPointer === true}">
<h3>
<ng-content select="[panelLeftButton]"></ng-content>
<div class="igo-panel-title">
Expand Down
4 changes: 4 additions & 0 deletions packages/common/src/lib/panel/panel.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
overflow: auto;
}

.igo-cursor-pointer {
cursor: pointer;
}

:host.igo-panel-with-header {
.igo-panel-content {
height: calc(100% - #{$igo-panel-header-height});
Expand Down
11 changes: 3 additions & 8 deletions packages/common/src/lib/panel/panel.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,7 @@ import {
changeDetection: ChangeDetectionStrategy.OnPush
})
export class PanelComponent {
@Input()
get title() {
return this._title;
}
set title(value: string) {
this._title = value;
}
private _title: string;
@Input() title: string;

@Input()
@HostBinding('class.igo-panel-with-header')
Expand All @@ -30,4 +23,6 @@ export class PanelComponent {
this._withHeader = value;
}
private _withHeader = true;

@Input() cursorPointer: boolean = false;
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ <h4><strong>{{ 'igo.integration.searchResultsTool.noResults' | translate }}</str
</div>

<div igoFlexibleFill class="igo-content">
<igo-panel [title]="featureTitle" *ngIf="feature$ | async">
<igo-panel [title]="featureTitle" *ngIf="feature$ | async" (click)="toggleTopPanel($event)" [cursorPointer]="true">

<button
mat-icon-button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -525,11 +525,15 @@ export class SearchResultsToolComponent implements OnInit, OnDestroy {
}
}

toggleTopPanel() {
if (this.topPanelState === 'expanded') {
this.topPanelState = 'collapsed';
toggleTopPanel(event?: MouseEvent) {
if(event && ((event.target as any)?.className !== 'igo-panel-title')) {
return;
} else {
this.topPanelState = 'expanded';
if (this.topPanelState === 'expanded') {
this.topPanelState = 'collapsed';
} else {
this.topPanelState = 'expanded';
}
}
}

Expand Down