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

View File

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

View File

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