Add timeline auto scroll

This commit is contained in:
2021-02-01 17:00:01 +01:00
parent 516e2e4f8b
commit 394b006468
5 changed files with 56 additions and 5 deletions
+3 -3
View File
@@ -190,7 +190,7 @@
</div>
</div>
</ion-header>
<ion-content>
<ion-content class="timeline">
<!-- Progress bar -->
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
@@ -200,7 +200,7 @@
</ion-refresher>
<!-- Timeline -->
<div *ngIf="showTimeline">
<div class="timeline-container" *ngIf="showTimeline">
<mwl-demo-utils-calendar-header class="timeline"
[(view)]="view"
[(viewDate)]="viewDate"
@@ -219,5 +219,5 @@
</div>
</div>
123123123123
</ion-content>
+19
View File
@@ -150,6 +150,20 @@ export class AgendaPage implements OnInit {
setCookie('searchModalAPPType','0', 99999999);
this.showLoader = false;
setTimeout(() => {
const timelineMarker = document.querySelector('.cal-current-time-marker');
const timelineContainer = document.querySelectorAll('ion-content')[2];
const shadowRoot = timelineContainer.shadowRoot;
const scrollContainer = shadowRoot.querySelector('main');
scrollContainer.scrollTop = timelineMarker['offsetTop'] - (window.screen.availHeight - (91 + 337 +56+140));
}, 2000);
}
ngOnInit() {
@@ -498,6 +512,7 @@ export class AgendaPage implements OnInit {
this.alertCrontroller.presentAlert("Funcionalidade em desenvolvimento.");
}
changeProfile(){
if(this.profile == "mdgpr"){
console.log('pr');
this.profile ="pr";
@@ -508,6 +523,10 @@ export class AgendaPage implements OnInit {
this.profile ="mdgpr";
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
}
// change header profile picture
window['header'](this.profile);
}
async openAddEvent() {