fix autoscroll to top on nav change

This commit is contained in:
tykayn 2021-12-21 16:45:19 +01:00 committed by Baptiste Lemoine
parent cd2e27c399
commit 087a1ba2de
3 changed files with 14 additions and 17 deletions

View File

@ -32,10 +32,9 @@ export class AppComponent implements OnInit, OnDestroy, AfterViewInit {
public themeClass: string;
public isSidebarOpened = false;
public devModeEnabled = !environment.production;
private themeSubscription: Subscription;
public environment = environment;
public onHomePage = false;
private themeSubscription: Subscription;
constructor(
private router: Router,
@ -71,8 +70,9 @@ export class AppComponent implements OnInit, OnDestroy, AfterViewInit {
console.log('evt', evt);
this.onHomePage = evt.url === '/';
window.scrollTo(0, 0);
setTimeout(() => {
window.scrollTo(0, 0);
}, 10);
});
if (!environment.production) {

View File

@ -1,18 +1,16 @@
<div class="day-list-container">
<div
class="columns days-list"
class="days-list"
cdkDropList
[ngClass]="{ 'colored-weekend-days': environment.enable_colored_weekend_days }"
[cdkDropListData]="dateChoices"
(cdkDropListDropped)="dropDayItem($event)"
>
<div class="column">
<div
*ngFor="let choice of dateChoices; index as id"
class="date-choice"
cdkDrag
[ngClass]="{ 'day-weekend': isWeekendDay(choice.date_input) }"
>
<div class="date-choice-container" *ngFor="let choice of dateChoices; index as id">
<p>
{{ choice.date_object | date: 'short' }}
</p>
<div class="date-choice" cdkDrag [ngClass]="{ 'day-weekend': isWeekendDay(choice.date_input) }">
<!-- <span class="button is-default">-->
<!-- <i class="icon fa fa-arrows-v"></i>-->
<!-- <span *ngIf="timeSlice.date_object">-->

View File

@ -40,14 +40,10 @@
<section class="same-time-slices">
<section class="same-time-slices" *ngIf="pollService.form.value.hasSeveralHours">
<h2 class="title is-2">
Choisissez les horaires ou options à appliquer à toutes les dates
Choisissez les horaires
</h2>
<section class="proposals" *ngIf="environment.creation_display_proposals_time_slices">
<h3 class="title is-3">
Propositions de créneaux horaires
</h3>
<div class="time-slices-proposals rounded-block">
<div
class="button is-rounded"
@ -115,6 +111,9 @@
</div>
</div>
</div>
<p>
Appliquer le même horaire / option à toutes les dates
</p>
</div>
<app-nav-steps