From 9dc9a39025bfe50f5516e3a4e87843c837dc8131 Mon Sep 17 00:00:00 2001 From: bozzelliandrea Date: Tue, 19 Jul 2022 13:02:29 +0200 Subject: [PATCH] [App]: Fixed vertical scrollbar for route module --- karma.conf.js | 2 +- src/app/app.component.ts | 2 ++ .../modules/plates/page/plate-page.component.ts | 14 ++++++-------- src/styles.scss | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/karma.conf.js b/karma.conf.js index 2ecd05d..16fd7be 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -3,7 +3,7 @@ module.exports = function (config) { config.set({ - basePath: 'app', + basePath: '', frameworks: ['jasmine', '@angular-devkit/build-angular'], plugins: [ require('karma-jasmine'), diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 9070520..2d8c151 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -13,6 +13,8 @@ import {PrimeNGConfig} from "primeng/api"; .app-container { height: 90vh; max-height: 90vh; + + overflow-y: auto; } `] }) diff --git a/src/app/modules/plates/page/plate-page.component.ts b/src/app/modules/plates/page/plate-page.component.ts index 3b1be24..fdb14dd 100644 --- a/src/app/modules/plates/page/plate-page.component.ts +++ b/src/app/modules/plates/page/plate-page.component.ts @@ -27,8 +27,7 @@ export class PlatePageComponent implements OnInit, OnDestroy { public config!: Plate; - private _routeSub: Subscription = new Subscription(); - private _plateSub: Subscription = new Subscription(); + private _subs: Subscription = new Subscription(); private _id?: string; constructor(private _route: ActivatedRoute, @@ -40,21 +39,20 @@ export class PlatePageComponent implements OnInit, OnDestroy { if (rootComponent) rootComponent.remove(); - this._routeSub = this._route.params.subscribe( + this._subs.add(this._route.params.subscribe( params => { this._id = params["id"]; } - ); + )); - this._plateSub = this._apiConnector.getPlate(this._id!) + this._subs.add(this._apiConnector.getPlate(this._id!) .subscribe((plate: Plate) => { this.config = plate; - }); + })); } public ngOnDestroy(): void { - this._routeSub.unsubscribe(); - this._plateSub.unsubscribe(); + this._subs.unsubscribe(); } } diff --git a/src/styles.scss b/src/styles.scss index de393ee..64cb9d7 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -4,7 +4,7 @@ html, body { } ::-webkit-scrollbar { - width: 5px; + width: 7px; } ::-webkit-scrollbar-track {