From 58e853e7b71ee409e74836ae2bc04ae27b6d0279 Mon Sep 17 00:00:00 2001 From: ztimson Date: Sun, 24 Mar 2019 11:13:20 -0400 Subject: [PATCH] Fixed double scroll in catalog --- src/app/app.component.html | 177 +++++++++++++------------ src/app/app.component.ts | 4 + src/app/catalog/catalog.component.html | 2 +- src/app/catalog/catalog.component.ts | 18 ++- src/assets/css/base.scss | 4 + 5 files changed, 110 insertions(+), 95 deletions(-) diff --git a/src/app/app.component.html b/src/app/app.component.html index 24455bc..95d22c1 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,95 +1,96 @@ +
+ - -
- - -
- + +
+
+
+
MAIN MENU
+ +
+
+
PRODUCTS
+ +
+
+
CONTACT
+

+ 416-744-2723 +
+ 416-744-4078 +
Toll Free: 1-888-422-7737 +

+
+
+ +
- - -
-
-
-
MAIN MENU
- -
-
-
PRODUCTS
- -
-
-
CONTACT
-

- 416-744-2723 -
- 416-744-4078 -
Toll Free: 1-888-422-7737 -

-
-
- -
diff --git a/src/app/app.component.ts b/src/app/app.component.ts index a461c01..d426c12 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -18,6 +18,10 @@ export class AppComponent implements OnInit { @LocalStorage({ defaultValue: [], encryptionKey: 'HmRoBFUEVWqW5uvy' }) cart: { id: string; item: string; option: POption, quantity: number}[]; + set lock(lock: boolean) { + document.getElementsByTagName('body')[0].classList[lock ? 'add' : 'remove']('lock'); + } + constructor( private router: Router, private dialog: MatDialog, diff --git a/src/app/catalog/catalog.component.html b/src/app/catalog/catalog.component.html index a5f7147..eeaf0b4 100644 --- a/src/app/catalog/catalog.component.html +++ b/src/app/catalog/catalog.component.html @@ -1 +1 @@ - + diff --git a/src/app/catalog/catalog.component.ts b/src/app/catalog/catalog.component.ts index ed6b967..4f828a3 100644 --- a/src/app/catalog/catalog.component.ts +++ b/src/app/catalog/catalog.component.ts @@ -1,16 +1,22 @@ -import {Component, OnInit} from "@angular/core"; -import {HttpClient} from "@angular/common/http"; +import {Component, OnDestroy, OnInit} from "@angular/core"; import {DomSanitizer} from "@angular/platform-browser"; +import {AppComponent} from "../app.component"; @Component({ selector: 'catalog', templateUrl: 'catalog.component.html' }) -export class CatalogComponent implements OnInit{ +export class CatalogComponent implements OnInit, OnDestroy { - constructor(private http: HttpClient, private sanatize: DomSanitizer) {} + constructor(private app: AppComponent, private sanitize: DomSanitizer) {} - ngOnInit() {} + ngOnInit() { + this.app.lock = true; + } - trust(url) { return this.sanatize.bypassSecurityTrustResourceUrl(url); } + ngOnDestroy() { + this.app.lock = false; + } + + trust(url) { return this.sanitize.bypassSecurityTrustResourceUrl(url); } } diff --git a/src/assets/css/base.scss b/src/assets/css/base.scss index e20c9c5..290ae7b 100644 --- a/src/assets/css/base.scss +++ b/src/assets/css/base.scss @@ -24,6 +24,10 @@ body { margin: 0; padding: 0; background-color: #292929; + + &.lock { + overflow: hidden; + } } .button-fix {