From 3ada66ac5f36c38502556f18982954d2526cce0e Mon Sep 17 00:00:00 2001 From: Baptiste Lemoine Date: Mon, 20 Jan 2020 15:15:06 +0100 Subject: [PATCH] :zap: erasable inputs on first config screen ok --- src/app/app.component.ts | 9 +- .../create-or-retrieve.component.html | 5 +- src/app/pages/dates/dates.component.html | 121 ++++++++++-------- src/app/pages/home/home.component.html | 3 + .../erasable-input.component.html | 9 +- .../erasable-input.component.ts | 3 +- 6 files changed, 90 insertions(+), 60 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 07b7058d..80ecc37f 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,6 +1,7 @@ -import {Component} from '@angular/core'; +import {Component, Inject} from '@angular/core'; import {TranslateService} from '@ngx-translate/core'; import {Router} from '@angular/router'; +import {DOCUMENT} from "@angular/common"; @Component({ selector: 'app-root', @@ -21,6 +22,7 @@ export class AppComponent { private step: string; constructor(private translate: TranslateService, + @Inject(DOCUMENT) private document, private route: Router) { this.translate.setDefaultLang(this.currentLang); this.detectCurrentTabOnRouteChange(); @@ -29,6 +31,7 @@ export class AppComponent { detectCurrentTabOnRouteChange() { this.route.events.subscribe((event: any) => { + this.scrollGoToTop(); if (event.url) { @@ -68,4 +71,8 @@ export class AppComponent { toggleMenu() { this.menuVisible = !this.menuVisible; } + + scrollGoToTop() { + this.document.documentElement.scrollTop = 0; + } } diff --git a/src/app/pages/create-or-retrieve/create-or-retrieve.component.html b/src/app/pages/create-or-retrieve/create-or-retrieve.component.html index 4ebcb54b..c6cd6ed0 100644 --- a/src/app/pages/create-or-retrieve/create-or-retrieve.component.html +++ b/src/app/pages/create-or-retrieve/create-or-retrieve.component.html @@ -28,7 +28,7 @@ >