diff options
Diffstat (limited to 'client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts')
-rw-r--r-- | client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts index d81859d5c..cea314cea 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { Component, OnInit, AfterViewChecked, ViewChild } from '@angular/core' | 1 | import { AfterViewChecked, Component, OnInit, ViewChild } from '@angular/core' |
2 | import { ConfigService } from '@app/+admin/config/shared/config.service' | 2 | import { ConfigService } from '@app/+admin/config/shared/config.service' |
3 | import { ServerService } from '@app/core/server/server.service' | 3 | import { ServerService } from '@app/core/server/server.service' |
4 | import { CustomConfigValidatorsService, FormReactive, UserValidatorsService } from '@app/shared' | 4 | import { CustomConfigValidatorsService, FormReactive, UserValidatorsService } from '@app/shared' |
@@ -10,7 +10,7 @@ import { SelectItem } from 'primeng/api' | |||
10 | import { forkJoin } from 'rxjs' | 10 | import { forkJoin } from 'rxjs' |
11 | import { ServerConfig } from '@shared/models' | 11 | import { ServerConfig } from '@shared/models' |
12 | import { ViewportScroller } from '@angular/common' | 12 | import { ViewportScroller } from '@angular/common' |
13 | import { NgbTabset } from '@ng-bootstrap/ng-bootstrap' | 13 | import { NgbNav } from '@ng-bootstrap/ng-bootstrap' |
14 | 14 | ||
15 | @Component({ | 15 | @Component({ |
16 | selector: 'my-edit-custom-config', | 16 | selector: 'my-edit-custom-config', |
@@ -18,7 +18,8 @@ import { NgbTabset } from '@ng-bootstrap/ng-bootstrap' | |||
18 | styleUrls: [ './edit-custom-config.component.scss' ] | 18 | styleUrls: [ './edit-custom-config.component.scss' ] |
19 | }) | 19 | }) |
20 | export class EditCustomConfigComponent extends FormReactive implements OnInit, AfterViewChecked { | 20 | export class EditCustomConfigComponent extends FormReactive implements OnInit, AfterViewChecked { |
21 | @ViewChild('tabs') tabs: NgbTabset | 21 | // FIXME: use built-in router |
22 | @ViewChild('nav') nav: NgbNav | ||
22 | 23 | ||
23 | initDone = false | 24 | initDone = false |
24 | customConfig: CustomConfig | 25 | customConfig: CustomConfig |
@@ -286,13 +287,13 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A | |||
286 | } | 287 | } |
287 | 288 | ||
288 | gotoAnchor () { | 289 | gotoAnchor () { |
289 | const hashToTab = { | 290 | const hashToNav = { |
290 | 'customizations': 'advanced-configuration' | 291 | 'customizations': 'advanced-configuration' |
291 | } | 292 | } |
292 | const hash = window.location.hash.replace('#', '') | 293 | const hash = window.location.hash.replace('#', '') |
293 | 294 | ||
294 | if (hash && Object.keys(hashToTab).includes(hash)) { | 295 | if (hash && Object.keys(hashToNav).includes(hash)) { |
295 | this.tabs.select(hashToTab[hash]) | 296 | this.nav.select(hashToNav[hash]) |
296 | setTimeout(() => this.viewportScroller.scrollToAnchor(hash), 100) | 297 | setTimeout(() => this.viewportScroller.scrollToAnchor(hash), 100) |
297 | } | 298 | } |
298 | } | 299 | } |