changeset 2017:7e45941acc1d

automatically open the first series to be loaded
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 03 Dec 2022 08:27:14 +0100
parents f30d7055ed6a
children 6099c7925202
files Applications/StoneWebViewer/NEWS Applications/StoneWebViewer/WebApplication/app.js
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Applications/StoneWebViewer/NEWS	Sat Dec 03 08:12:14 2022 +0100
+++ b/Applications/StoneWebViewer/NEWS	Sat Dec 03 08:27:14 2022 +0100
@@ -3,6 +3,7 @@
 
 * Click-drag is available on the vertical slider
 * New URL argument "menu" to change the layout of the list of studies/series
+* The first series to be loaded is now automatically opened
 * Annotations are grouped into one submenu for narrow screens
 * Fix measurement of arcs
 * Width of the vertical slider has doubled to ease user interactions
--- a/Applications/StoneWebViewer/WebApplication/app.js	Sat Dec 03 08:12:14 2022 +0100
+++ b/Applications/StoneWebViewer/WebApplication/app.js	Sat Dec 03 08:27:14 2022 +0100
@@ -474,6 +474,7 @@
       orthancSystem: {},  // Only available if "OrthancApiRoot" configuration option is set
       stoneWebViewerVersion: '...',
       emscriptenVersion: '...',
+      isFirstSeries: true,
 
       modalWarning: false,
       modalNotDiagnostic: false,
@@ -1216,6 +1217,12 @@
       var studyInstanceUid = args.detail.studyInstanceUid;
       var seriesInstanceUid = args.detail.seriesInstanceUid;
       that.UpdateIsSeriesComplete(studyInstanceUid, seriesInstanceUid);
+
+      // Automatically open the first series to be loaded (new in Stone Web viewer 2.5)
+      if (that.isFirstSeries) {
+        that.SetViewportSeriesInstanceUid(1, seriesInstanceUid);
+        that.isFirstSeries = false;
+      }
     });
 
     window.addEventListener('StoneAnnotationAdded', function() {