# HG changeset patch # User Alain Mazy # Date 1727942034 -7200 # Node ID 4f224edac3481c81372aa27c1dfb517c669ef6f3 # Parent 917e40af6b45572476986fd47f5be559857e8f50 Remember the previous layout when re-opening the viewer diff -r 917e40af6b45 -r 4f224edac348 Applications/StoneWebViewer/NEWS --- a/Applications/StoneWebViewer/NEWS Fri Sep 27 22:29:51 2024 +0200 +++ b/Applications/StoneWebViewer/NEWS Thu Oct 03 09:53:54 2024 +0200 @@ -1,6 +1,8 @@ Pending changes in the mainline =============================== +* Remember the previous layout when re-opening the viewer. + Version 2.6 (2024-08-31) ======================== diff -r 917e40af6b45 -r 4f224edac348 Applications/StoneWebViewer/WebApplication/app.js --- 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');