Reset blockchain scroll on logo click
This commit is contained in:
		
							parent
							
								
									9a99ee6486
								
							
						
					
					
						commit
						57ac1486a0
					
				| @ -1,7 +1,7 @@ | |||||||
| <ng-container *ngIf="{ val: network$ | async } as network"> | <ng-container *ngIf="{ val: network$ | async } as network"> | ||||||
| <header> | <header> | ||||||
|   <nav class="navbar navbar-expand-md navbar-dark bg-dark"> |   <nav class="navbar navbar-expand-md navbar-dark bg-dark"> | ||||||
|   <a class="navbar-brand" [ngClass]="{'dual-logos': subdomain}" [routerLink]="['/' | relativeUrl]"> |   <a class="navbar-brand" [ngClass]="{'dual-logos': subdomain}" [routerLink]="['/' | relativeUrl]" (click)="brandClick($event)"> | ||||||
|   <ng-template [ngIf]="subdomain"> |   <ng-template [ngIf]="subdomain"> | ||||||
|     <div class="subdomain_container"> |     <div class="subdomain_container"> | ||||||
|       <img [src]="'/api/v1/enterprise/images/' + subdomain + '/logo'" class="subdomain_logo"> |       <img [src]="'/api/v1/enterprise/images/' + subdomain + '/logo'" class="subdomain_logo"> | ||||||
|  | |||||||
| @ -53,4 +53,8 @@ export class MasterPageComponent implements OnInit { | |||||||
|   onResize(): void { |   onResize(): void { | ||||||
|     this.isMobile = window.innerWidth <= 767.98; |     this.isMobile = window.innerWidth <= 767.98; | ||||||
|   } |   } | ||||||
|  | 
 | ||||||
|  |   brandClick(e): void { | ||||||
|  |     this.stateService.resetScroll$.next(true); | ||||||
|  |   } | ||||||
| } | } | ||||||
|  | |||||||
| @ -25,6 +25,7 @@ export class StartComponent implements OnInit, OnDestroy { | |||||||
|   markBlockSubscription: Subscription; |   markBlockSubscription: Subscription; | ||||||
|   blockCounterSubscription: Subscription; |   blockCounterSubscription: Subscription; | ||||||
|   @ViewChild('blockchainContainer') blockchainContainer: ElementRef; |   @ViewChild('blockchainContainer') blockchainContainer: ElementRef; | ||||||
|  |   resetScrollSubscription: Subscription;  | ||||||
| 
 | 
 | ||||||
|   isMobile: boolean = false; |   isMobile: boolean = false; | ||||||
|   isiOS: boolean = false; |   isiOS: boolean = false; | ||||||
| @ -106,6 +107,12 @@ export class StartComponent implements OnInit, OnDestroy { | |||||||
|           }, 60 * 60 * 1000); |           }, 60 * 60 * 1000); | ||||||
|         } |         } | ||||||
|       }); |       }); | ||||||
|  |     this.resetScrollSubscription = this.stateService.resetScroll$.subscribe(reset => { | ||||||
|  |       if (reset) { | ||||||
|  |         this.resetScroll(); | ||||||
|  |         this.stateService.resetScroll$.next(false); | ||||||
|  |       }  | ||||||
|  |     }); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   @HostListener('window:resize', ['$event']) |   @HostListener('window:resize', ['$event']) | ||||||
| @ -385,5 +392,6 @@ export class StartComponent implements OnInit, OnDestroy { | |||||||
|     this.chainTipSubscription.unsubscribe(); |     this.chainTipSubscription.unsubscribe(); | ||||||
|     this.markBlockSubscription.unsubscribe(); |     this.markBlockSubscription.unsubscribe(); | ||||||
|     this.blockCounterSubscription.unsubscribe(); |     this.blockCounterSubscription.unsubscribe(); | ||||||
|  |     this.resetScrollSubscription.unsubscribe(); | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  | |||||||
| @ -126,6 +126,7 @@ export class StateService { | |||||||
|   keyNavigation$ = new Subject<KeyboardEvent>(); |   keyNavigation$ = new Subject<KeyboardEvent>(); | ||||||
| 
 | 
 | ||||||
|   blockScrolling$: Subject<boolean> = new Subject<boolean>(); |   blockScrolling$: Subject<boolean> = new Subject<boolean>(); | ||||||
|  |   resetScroll$: Subject<boolean> = new Subject<boolean>(); | ||||||
|   timeLtr: BehaviorSubject<boolean>; |   timeLtr: BehaviorSubject<boolean>; | ||||||
|   hideFlow: BehaviorSubject<boolean>; |   hideFlow: BehaviorSubject<boolean>; | ||||||
|   hideAudit: BehaviorSubject<boolean>; |   hideAudit: BehaviorSubject<boolean>; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user