From b0d40902c17f1959974509ba1c9c4ac4a059268c Mon Sep 17 00:00:00 2001 From: Miri Sachs Date: Mon, 25 Nov 2024 13:39:17 -0700 Subject: [PATCH] Update title after setting tracks --- .../well-log-viewer/src/components/WellLogView.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/typescript/packages/well-log-viewer/src/components/WellLogView.tsx b/typescript/packages/well-log-viewer/src/components/WellLogView.tsx index 9ea0e86b7..767ef9007 100644 --- a/typescript/packages/well-log-viewer/src/components/WellLogView.tsx +++ b/typescript/packages/well-log-viewer/src/components/WellLogView.tsx @@ -1287,6 +1287,7 @@ class WellLogView wellLogSets: WellLogSet[]; container?: HTMLElement; + title?: HTMLElement; resizeObserver: ResizeObserver; logController?: LogViewer; @@ -1570,6 +1571,7 @@ class WellLogView this.props.colorMapFunctions ); addWellPickOverlay(this.logController, this); + this._updateWellLogTitle(); } this.setControllerZoom(); this.setControllerSelection(); @@ -1792,6 +1794,11 @@ class WellLogView element.setAttribute("title", element.textContent); } } + _updateWellLogTitle(): void { + if (this.title && this.props.viewTitle === true) { + this.title.textContent = this.wellLogSets[0]?.header.well ?? null; + } + } scrollTrackBy(delta: number): void { this.setState((state: Readonly) => ({ @@ -2082,6 +2089,7 @@ class WellLogView className={ horizontal ? "title title-horizontal" : "title" } + ref={(el) => (this.title = el as HTMLElement)} > {this.createViewTitle(viewTitle)}