mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Merge remote-tracking branch 'remotes/origin/master' into submission
# Conflicts: # src/app/+search-page/search-service/search.service.spec.ts # src/app/app.component.spec.ts # src/app/app.component.ts # src/app/core/auth/auth-response-parsing.service.ts # src/app/core/cache/models/normalized-object-factory.ts # src/app/core/cache/models/normalized-resource-policy.model.ts # src/app/core/core.module.ts # src/app/core/data/base-response-parsing.service.ts # src/app/core/data/config-response-parsing.service.spec.ts # src/app/core/data/config-response-parsing.service.ts # src/app/core/data/dso-response-parsing.service.ts # src/app/core/data/request.models.ts # src/app/core/data/search-response-parsing.service.ts # src/app/core/integration/integration-response-parsing.service.spec.ts # src/app/core/integration/integration-response-parsing.service.ts # src/app/core/shared/item.model.ts # src/app/core/shared/resource-policy.model.ts # src/app/core/shared/resource-type.ts # src/app/shared/shared.module.ts # src/app/thumbnail/thumbnail.component.html
This commit is contained in:
@@ -1,4 +1,13 @@
|
||||
import { ChangeDetectionStrategy, Component, HostListener, Inject, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import {
|
||||
AfterViewInit,
|
||||
ChangeDetectionStrategy,
|
||||
Component,
|
||||
HostListener,
|
||||
Inject,
|
||||
OnInit,
|
||||
ViewEncapsulation
|
||||
} from '@angular/core';
|
||||
import { NavigationCancel, NavigationEnd, NavigationStart, Router } from '@angular/router';
|
||||
|
||||
import { Store } from '@ngrx/store';
|
||||
|
||||
@@ -22,7 +31,8 @@ import { RouteService } from './shared/services/route.service';
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class AppComponent implements OnInit {
|
||||
export class AppComponent implements OnInit, AfterViewInit {
|
||||
isLoading = true;
|
||||
|
||||
constructor(
|
||||
@Inject(GLOBAL_CONFIG) public config: GlobalConfig,
|
||||
@@ -32,6 +42,7 @@ export class AppComponent implements OnInit {
|
||||
private metadata: MetadataService,
|
||||
private angulartics2GoogleAnalytics: Angulartics2GoogleAnalytics,
|
||||
private authService: AuthService,
|
||||
private router: Router,
|
||||
private routeService: RouteService
|
||||
) {
|
||||
// this language will be used as a fallback when a translation isn't found in the current language
|
||||
@@ -62,6 +73,20 @@ export class AppComponent implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
this.router.events
|
||||
.subscribe((event) => {
|
||||
if (event instanceof NavigationStart) {
|
||||
this.isLoading = true;
|
||||
} else if (
|
||||
event instanceof NavigationEnd ||
|
||||
event instanceof NavigationCancel
|
||||
) {
|
||||
this.isLoading = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@HostListener('window:resize', ['$event'])
|
||||
private onResize(event): void {
|
||||
this.dispatchWindowSize(event.target.innerWidth, event.target.innerHeight);
|
||||
|
Reference in New Issue
Block a user