mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Improve timeline
This commit is contained in:
@@ -131,14 +131,10 @@ export class AgendaPage implements OnInit {
|
||||
private router: Router,
|
||||
private alertCrontroller: AlertService
|
||||
) {
|
||||
|
||||
// timeline inicial date
|
||||
this.timelineDate = formatDate(new Date,'dd MMMM yyyy', 'pt');
|
||||
|
||||
setTimeout(()=>{
|
||||
// console.log(JSON.stringify(this.events));
|
||||
// console.log(this.events);
|
||||
},5000)
|
||||
|
||||
// console.log(setHours(setMinutes(new Date(), 0), 12))
|
||||
|
||||
function setCookie(cname, cvalue, exdays) {
|
||||
var d = new Date();
|
||||
@@ -173,12 +169,9 @@ export class AgendaPage implements OnInit {
|
||||
});
|
||||
|
||||
|
||||
|
||||
this.centralizeTimeline();
|
||||
|
||||
}
|
||||
|
||||
centralizeTimeline() {
|
||||
centralizeTimeline(timeout: number) {
|
||||
// auto scroll timeline
|
||||
setTimeout(() => {
|
||||
const timelineMarker = document.querySelector('.cal-current-time-marker');
|
||||
@@ -189,7 +182,7 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
scrollContainer.scrollTop = timelineMarker['offsetTop'] - (scrollContainer.offsetHeight/2);
|
||||
|
||||
}, 2000);
|
||||
}, timeout);
|
||||
}
|
||||
|
||||
timelineIsCurrentDate(): Boolean {
|
||||
@@ -257,7 +250,7 @@ export class AgendaPage implements OnInit {
|
||||
this.viewDate = new Date(formatDate(ev,'yyyy-MM-dd', 'pt'));
|
||||
// calendar change date
|
||||
this.eventSelectedDate = new Date(ev);
|
||||
this.centralizeTimeline();
|
||||
this.centralizeTimeline(1000);
|
||||
};
|
||||
|
||||
// changedate
|
||||
@@ -379,7 +372,7 @@ export class AgendaPage implements OnInit {
|
||||
this.showLoader = false;
|
||||
this.showTimeline = true;
|
||||
|
||||
this.centralizeTimeline();
|
||||
this.centralizeTimeline(1000);
|
||||
|
||||
});
|
||||
|
||||
@@ -422,7 +415,7 @@ export class AgendaPage implements OnInit {
|
||||
this.showLoader = false;
|
||||
this.showTimeline = true;
|
||||
|
||||
this.centralizeTimeline();
|
||||
this.centralizeTimeline(1000);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user