diff Applications/StoneWebViewer/WebApplication/app.js @ 2162:4f224edac348 default tip

Remember the previous layout when re-opening the viewer
author Alain Mazy <am@orthanc.team>
date Thu, 03 Oct 2024 09:53:54 +0200
parents 16c01cc201e7
children
line wrap: on
line diff
--- a/Applications/StoneWebViewer/WebApplication/app.js	Fri Sep 27 22:29:51 2024 +0200
+++ b/Applications/StoneWebViewer/WebApplication/app.js	Thu Oct 03 09:53:54 2024 +0200
@@ -960,7 +960,7 @@
         this.layoutCountX = 1;
         this.layoutCountY = 2;
       }
-
+      localStorage.setItem('layout', layout);
       this.FitContent();
     },
 
@@ -1369,7 +1369,11 @@
   mounted: function() {
     // Warning: In this function, the "stone" global object is not initialized yet!
     
-    this.SetViewportLayout('1x1');
+    if (localStorage.layout) {
+      this.SetViewportLayout(localStorage.layout);
+    } else {
+      this.SetViewportLayout('1x1');
+    }
 
     if (localStorage.settingNotDiagnostic) {
       this.settingNotDiagnostic = (localStorage.settingNotDiagnostic == '1');