fix loader

This commit is contained in:
Peter Maquiran
2023-06-09 12:02:11 +01:00
parent 91588ebb24
commit 7f3cfdc55e
10 changed files with 58 additions and 41 deletions
@@ -1,4 +1,4 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
import { ProcessesService } from 'src/app/services/processes.service';
import { ModalController } from '@ionic/angular';
import {NavigationEnd, NavigationExtras, Router } from '@angular/router';
@@ -102,6 +102,11 @@ export class GabineteDigitalPage implements OnInit {
AllProcess = []
ordinance: string = 'old'
refresh = true
@ViewChild('scroll') scroll: ElementRef;
constructor(
private processesbackend: ProcessesService,
private modalController: ModalController,
@@ -191,7 +196,7 @@ export class GabineteDigitalPage implements OnInit {
reorderList(orderBy: string) {
this.changeTab()
this.ordinance = orderBy;
this.dynamicSearch();
@@ -256,9 +261,31 @@ export class GabineteDigitalPage implements OnInit {
});
this.hideRefreshButton();
// console.log(' this.scroll', this.scroll)
// this.scroll.nativeElement.addEventListener("scroll", ()=> {
// console.log('123')
// });
}
ngAfterViewInit(): void {
// We can access the TestComponent now that this portion of the view tree has been initiated.
const element = this.scroll.nativeElement
this.scroll.nativeElement.addEventListener("scroll", (e)=> {
this.changeTab()
});
}
changeTab() {
const element = this.scroll.nativeElement
if(element.scrollTop == 0 ) {
this.refresh = true
} else {
this.refresh = false
}
}
checkFilter() {