Skip to content

Commit

Permalink
Add dynamic style.top value to the search result component
Browse files Browse the repository at this point in the history
1.Fixes goharbor#20608
Signed-off-by: Shijun Sun <[email protected]>
  • Loading branch information
AllForNothing committed Aug 2, 2024
1 parent 295e075 commit f1cda5f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="search-overlay" *ngIf="state">
<div [style.top.px]="getTopValue()" class="search-overlay" *ngIf="state">
<div id="placeholder1"></div>
<div class="search-header">
<a href="javascript:void(0)" (click)="close()"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,11 @@ export class SearchResultComponent implements OnInit, OnDestroy {
}
);
}
getTopValue(): number {
const headerHeight: number =
document.querySelector('navigator')?.clientHeight || 0;
const bannerHeight: number =
document.querySelector('app-app-level-alerts')?.clientHeight || 0;
return headerHeight + bannerHeight;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
z-index: 999;
box-sizing: border-box;
background: #fafafa;
top: 60px;
left: 0;
padding-left: 36px;
padding-right: 36px;
Expand Down

0 comments on commit f1cda5f

Please sign in to comment.