Skip to content

Commit

Permalink
[GoldenLayout] Prevent popouts to be docked when layout is loaded
Browse files Browse the repository at this point in the history
The beforeunload event responsible for docking popouts is called
when PopInOnClose = true. In case a layout is loaded or set, open
popouts are closed which would cause them to be docked via this
event.
  • Loading branch information
hyazinthh committed Dec 21, 2023
1 parent a6968cf commit 76bae9a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Scratch/25 - GoldenLayout/App.fs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let initialCamera = {
}

let layoutConfig =
{ LayoutConfig.Default with PopInOnClose = false }
LayoutConfig.Default

let initialLayout =
row {
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ if (!aardvark.golden) {

aardvark.golden.setLayout = function (layoutElement, config) {
const instance = aardvark.golden.instances.get(layoutElement.id);
instance.layout.closeAllOpenPopouts();
instance.layout.closeAllOpenPopouts(true);
instance.layout.loadLayout(config);
}

Expand All @@ -128,7 +128,7 @@ if (!aardvark.golden) {
try {
const savedLayout = JSON.parse(savedData);
const config = goldenLayout.LayoutConfig.fromResolved(savedLayout);
instance.layout.closeAllOpenPopouts();
instance.layout.closeAllOpenPopouts(true);
instance.layout.loadLayout(config);
} catch (error) {
console.error('Failed to load layout: ' + error);
Expand Down

0 comments on commit 76bae9a

Please sign in to comment.