Add small delay before scrolling to url hash item.

Override ngPrime progress bar label styling, by enforcing the display of 0 value
This commit is contained in:
krommydas kyriakos 2017-12-12 13:33:14 +02:00
parent f3ac0b6e82
commit b00ef417af
3 changed files with 9 additions and 6 deletions

View File

@ -95,9 +95,9 @@ export class DynamicFormComponent implements OnInit {
this.visibilityRulesService.buildVisibilityRules(rules) this.visibilityRulesService.buildVisibilityRules(rules)
this.progressbar = true; this.progressbar = true;
this.route.fragment.subscribe((fragment: string) => { this.route.fragment.subscribe((fragment: string) => {
//if (fragment) var self = this;
this.scrollTo(fragment); setTimeout(function () { self.scrollTo(fragment) });
}); });
this.route.queryParams.subscribe((params) => { this.route.queryParams.subscribe((params) => {

View File

@ -1 +1 @@
<p-progressBar [value]="value" [style]="{'height': '30px'}"></p-progressBar> <p-progressBar [value]="value" [style]="{'height': '30px'}" [styleClass]="'alwaysVisible'"></p-progressBar>

View File

@ -1,10 +1,13 @@
import { VisibilityRulesService } from '../../visibility-rules/visibility-rules.service'; import { VisibilityRulesService } from '../../visibility-rules/visibility-rules.service';
import { ViewEncapsulation } from '@angular/core';
import { Component, Input, OnInit } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { FormGroup, FormControl, FormArray } from '@angular/forms' import { FormGroup, FormControl, FormArray } from '@angular/forms'
@Component({ @Component({
selector: 'progress-bar', selector: 'progress-bar',
templateUrl: './progress-bar.component.html', templateUrl: './progress-bar.component.html',
styles: ['.alwaysVisible .ui-progressbar-label { display:block!important; }'],
encapsulation: ViewEncapsulation.None
}) })
export class ProgressBarComponent implements OnInit { export class ProgressBarComponent implements OnInit {
@Input() formGroup: FormGroup @Input() formGroup: FormGroup
@ -12,7 +15,7 @@ export class ProgressBarComponent implements OnInit {
constructor(private visibilityRulesService: VisibilityRulesService) { } constructor(private visibilityRulesService: VisibilityRulesService) { }
private value: number; private value: number = 0;
ngOnInit() { ngOnInit() {
this.formGroup this.formGroup
.valueChanges .valueChanges