diff --git a/src/app/components/pb-schema/pb-schema.component.ts b/src/app/components/pb-schema/pb-schema.component.ts index 347e451a60ebbd931b9e74ea329cac8ae72a1685..20b44a7c408e98ed9f5bf4d4a32d2e2fbefe6579 100644 --- a/src/app/components/pb-schema/pb-schema.component.ts +++ b/src/app/components/pb-schema/pb-schema.component.ts @@ -124,6 +124,12 @@ export class PbSchemaComponent implements AfterViewInit, AfterContentInit, OnIni this.selectNodeOnSchema(this._selectedItem); }, 20); // timeout has to be greater than the 10ms of ngAfterViewInit() } + else { + // select upstream basin since it's form is already displayed (and not undisplayable...) + setTimeout(() => { + this.selectUpstreamBasin(); + }, 20); // timeout has to be greater than the 10ms of ngAfterViewInit() + } } private render() { @@ -421,6 +427,21 @@ export class PbSchemaComponent implements AfterViewInit, AfterContentInit, OnIni }); } + /** + * select upstream basin on schema + */ + private selectUpstreamBasin() { + let done = false; // optimisation : simulate break in forEach + this.nativeElement.querySelectorAll("g.node").forEach(item => { + if (!done) { + if (MermaidUtil.isMermaidId("amont", item.id)) { + this.selectNode(item); + done = true; + } + } + }); + } + // at this time @Input data is supposed to be already populated public ngOnInit() { this.model = this.pbSchema.pb;