Front: temporary disable search
This commit is contained in:
@@ -10,9 +10,8 @@ import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatGridListModule } from '@angular/material/grid-list';
|
||||
import { MatSelectModule } from '@angular/material/select';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { MatChipInputEvent, MatChipsModule} from '@angular/material/chips';
|
||||
import { MatChipsModule} from '@angular/material/chips';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import {COMMA, ENTER, TAB} from '@angular/cdk/keycodes';
|
||||
import { NgFor } from '@angular/common';
|
||||
|
||||
@Component({
|
||||
@@ -30,12 +29,12 @@ export class LayersListComponent implements OnInit {
|
||||
|
||||
@ViewChild(MatSort) sort!: MatSort;
|
||||
|
||||
start: number = 0;
|
||||
limit: number = 50;
|
||||
start = 0;
|
||||
limit = 50;
|
||||
end: number = this.limit + this.start;
|
||||
loadingInProgress: boolean = false;
|
||||
loadingInProgress = false;
|
||||
|
||||
type: string = "";
|
||||
type = "";
|
||||
codes: string[] = [];
|
||||
|
||||
constructor(
|
||||
@@ -43,10 +42,11 @@ export class LayersListComponent implements OnInit {
|
||||
) { }
|
||||
|
||||
@HostListener('document:scroll', ['$event'])
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
public async onScroll(event: any) {
|
||||
if (event.target.offsetHeight + event.target.scrollTop >= event.target.scrollHeight - 1 && !this.loadingInProgress) {
|
||||
this.loadingInProgress = true;
|
||||
let data: Layer[] = await Layer.getList(this._http, this.start, this.limit, this.codes);
|
||||
const data: Layer[] = await Layer.getList(this._http, this.start, this.limit, this.codes);
|
||||
this.dataSource.data = this.dataSource.data.concat(data);
|
||||
this.start = this.end;
|
||||
this.end = this.limit + this.start;
|
||||
|
||||
Reference in New Issue
Block a user