Release v1.6.8 - Log Parser Update v1 #23
|
@ -30,7 +30,7 @@ export class AppComponent {
|
||||||
}
|
}
|
||||||
if (event instanceof NavigationEnd) {
|
if (event instanceof NavigationEnd) {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
if (router.url.includes('overview')) {
|
if (router.url.includes(RouteConfig.overviewPath)) {
|
||||||
window.scrollTo({left: 0, top: 0, behavior: 'smooth'});
|
window.scrollTo({left: 0, top: 0, behavior: 'smooth'});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ import {RouteConfig} from "../app.config";
|
||||||
import {AwardingService} from "../services/army-management/awarding.service";
|
import {AwardingService} from "../services/army-management/awarding.service";
|
||||||
import {Fraction} from "../utils/fraction.enum";
|
import {Fraction} from "../utils/fraction.enum";
|
||||||
import {DOCUMENT} from "@angular/common";
|
import {DOCUMENT} from "@angular/common";
|
||||||
|
import {CSSHelpers} from "../global.helpers";
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -37,12 +38,7 @@ export class ArmyMemberComponent {
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
// set background image css
|
// set background image css
|
||||||
const backgroundCss = ' background-image: url(../assets/bg.jpg);\n' +
|
this.document.getElementById('right').setAttribute('style', CSSHelpers.getBackgroundCSS('../assets/bg.jpg'));
|
||||||
' background-size: cover;\n' +
|
|
||||||
' background-attachment: fixed;\n' +
|
|
||||||
' background-position: center;\n' +
|
|
||||||
' background-repeat: no-repeat;';
|
|
||||||
this.document.getElementById('right').setAttribute('style', backgroundCss);
|
|
||||||
|
|
||||||
this.subscription = this.route.params
|
this.subscription = this.route.params
|
||||||
.map(params => params['id'])
|
.map(params => params['id'])
|
||||||
|
@ -59,8 +55,10 @@ export class ArmyMemberComponent {
|
||||||
};
|
};
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
|
if (this.router.url !== '/' + RouteConfig.overviewPath) {
|
||||||
this.document.getElementById('right').setAttribute('style', '');
|
this.document.getElementById('right').setAttribute('style', '');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
backToOverview() {
|
backToOverview() {
|
||||||
this.router.navigate([RouteConfig.overviewPath]);
|
this.router.navigate([RouteConfig.overviewPath]);
|
||||||
|
|
|
@ -4,6 +4,8 @@ import {ArmyService} from "../services/army-service/army.service";
|
||||||
import {ActivatedRoute, Router} from "@angular/router";
|
import {ActivatedRoute, Router} from "@angular/router";
|
||||||
import {Fraction} from "../utils/fraction.enum";
|
import {Fraction} from "../utils/fraction.enum";
|
||||||
import {DOCUMENT} from "@angular/common";
|
import {DOCUMENT} from "@angular/common";
|
||||||
|
import {RouteConfig} from "../app.config";
|
||||||
|
import {CSSHelpers} from "../global.helpers";
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -25,12 +27,7 @@ export class ArmyComponent {
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
// set background image css
|
// set background image css
|
||||||
const backgroundCss = ' background-image: url(../assets/bg.jpg);\n' +
|
this.document.getElementById('right').setAttribute('style', CSSHelpers.getBackgroundCSS('../assets/bg.jpg'));
|
||||||
' background-size: cover;\n' +
|
|
||||||
' background-attachment: fixed;\n' +
|
|
||||||
' background-position: center;\n' +
|
|
||||||
' background-repeat: no-repeat;';
|
|
||||||
this.document.getElementById('right').setAttribute('style', backgroundCss);
|
|
||||||
|
|
||||||
// init army data
|
// init army data
|
||||||
this.armyService.getArmy()
|
this.armyService.getArmy()
|
||||||
|
@ -40,8 +37,10 @@ export class ArmyComponent {
|
||||||
};
|
};
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
|
if (this.router.url.includes(RouteConfig.overviewPath)) {
|
||||||
this.document.getElementById('right').setAttribute('style', '');
|
this.document.getElementById('right').setAttribute('style', '');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
select(memberId) {
|
select(memberId) {
|
||||||
this.router.navigate([{outlets: {'right': ['member', memberId]}}], {relativeTo: this.route});
|
this.router.navigate([{outlets: {'right': ['member', memberId]}}], {relativeTo: this.route});
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
export const CSSHelpers = {
|
||||||
|
getBackgroundCSS: (imageUrl) => {
|
||||||
|
return 'background-image: url(' + imageUrl + ');' +
|
||||||
|
'background-size: cover;' +
|
||||||
|
'background-attachment: fixed;' +
|
||||||
|
'background-position: center;' +
|
||||||
|
'background-repeat: no-repeat;';
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in New Issue