Mercurial > hg > orthanc-stone
changeset 2263:81f749ec6e9f
fix reaction to series ready
| author | Sebastien Jodogne <s.jodogne@gmail.com> |
|---|---|
| date | Wed, 03 Dec 2025 21:01:23 +0100 |
| parents | b3219cfccd3d |
| children | 2fde13a79353 29aff6de9acc |
| files | Applications/StoneWebViewer/WebApplication/app.js |
| diffstat | 1 files changed, 45 insertions(+), 27 deletions(-) [+] |
line wrap: on
line diff
--- a/Applications/StoneWebViewer/WebApplication/app.js Wed Dec 03 18:34:00 2025 +0100 +++ b/Applications/StoneWebViewer/WebApplication/app.js Wed Dec 03 21:01:23 2025 +0100 @@ -279,9 +279,12 @@ var seriesInstanceUid = newVal.series.tags[SERIES_INSTANCE_UID]; stone.SpeedUpFetchSeriesMetadata(studyInstanceUid, seriesInstanceUid); - if (newVal.series.type == stone.ThumbnailType.IMAGE || - newVal.series.type == stone.ThumbnailType.STRUCTURED_REPORT || - newVal.series.type == stone.ThumbnailType.NO_PREVIEW) { + if (newVal.series.type == stone.ThumbnailType.LOADING) { + // Ignore + } + else if (newVal.series.type == stone.ThumbnailType.IMAGE || + newVal.series.type == stone.ThumbnailType.STRUCTURED_REPORT || + newVal.series.type == stone.ThumbnailType.NO_PREVIEW) { if (newVal.series.complete) { this.status = 'ready'; @@ -990,6 +993,43 @@ this.FitContent(); }, + UpdateSeriesAndViewports: function(seriesInstanceUid, series) { + if (seriesInstanceUid in this.seriesIndex) { + var index = this.seriesIndex[seriesInstanceUid]; + + // https://fr.vuejs.org/2016/02/06/common-gotchas/#Why-isn%E2%80%99t-the-DOM-updating + this.$set(this.series, index, series); + + if ('tags' in this.viewport1Content.series && + this.viewport1Content.series.tags[SERIES_INSTANCE_UID] == seriesInstanceUid) { + var content = this.viewport1Content.series; + content.series = series; + this.viewport1Content = content; + } + + if ('tags' in this.viewport2Content.series && + this.viewport2Content.series.tags[SERIES_INSTANCE_UID] == seriesInstanceUid) { + var content = this.viewport2Content.series; + content.series = series; + this.viewport2Content = content; + } + + if ('tags' in this.viewport3Content.series && + this.viewport3Content.series.tags[SERIES_INSTANCE_UID] == seriesInstanceUid) { + var content = this.viewport3Content.series; + content.series = series; + this.viewport3Content = content; + } + + if ('tags' in this.viewport4Content.series && + this.viewport4Content.series.tags[SERIES_INSTANCE_UID] == seriesInstanceUid) { + var content = this.viewport4Content.series; + content.series = series; + this.viewport4Content = content; + } + } + }, + UpdateSeriesThumbnail: function(seriesInstanceUid) { if (seriesInstanceUid in this.seriesIndex) { var index = this.seriesIndex[seriesInstanceUid]; @@ -1002,8 +1042,7 @@ series.thumbnail = stone.GetStringBuffer(); } - // https://fr.vuejs.org/2016/02/06/common-gotchas/#Why-isn%E2%80%99t-the-DOM-updating - this.$set(this.series, index, series); + this.UpdateSeriesAndViewports(seriesInstanceUid, series); } }, @@ -1031,28 +1070,7 @@ } } - // https://fr.vuejs.org/2016/02/06/common-gotchas/#Why-isn%E2%80%99t-the-DOM-updating - this.$set(this.series, index, series); - - if ('tags' in this.viewport1Content.series && - this.viewport1Content.series.tags[SERIES_INSTANCE_UID] == seriesInstanceUid) { - this.$set(this.viewport1Content.series, series); - } - - if ('tags' in this.viewport2Content.series && - this.viewport2Content.series.tags[SERIES_INSTANCE_UID] == seriesInstanceUid) { - this.$set(this.viewport2Content.series, series); - } - - if ('tags' in this.viewport3Content.series && - this.viewport3Content.series.tags[SERIES_INSTANCE_UID] == seriesInstanceUid) { - this.$set(this.viewport3Content.series, series); - } - - if ('tags' in this.viewport4Content.series && - this.viewport4Content.series.tags[SERIES_INSTANCE_UID] == seriesInstanceUid) { - this.$set(this.viewport4Content.series, series); - } + this.UpdateSeriesAndViewports(seriesInstanceUid, series); } },
