GedMarc / layout

jQuery UI Layout v1.x plugin
Other
54 stars 24 forks source link

Saving state in nested layouts #27

Closed semrola closed 2 years ago

semrola commented 2 years ago

I specify the layout like this:

$(".pane").layout({
    applyDefaultStyles: true,
    north: {minSize: 100, size: 300},
    north__childOptions: {
        applyDefaultStyles: true,
        west__minSize: 100,
        west__maxSize: 300,
        west__paneSelector: ".n-west",
        center__paneSelector: ".n-center",
    },
    stateManagement__enabled: true,
    stateManagement__includeChildren: true,  // this should already be by default
    center__paneSelector: ".c-pane",
    north__paneSelector: ".n-pane",
});

but only the top layout state gets saved. Am I doing anything wrong or is there a bug? If I put the stateManagement__enabled in the child options, then only this one would be saved and the top one wouldn't. Edit: also the demo saved_state_nested.html is not saving the state.

GedMarc commented 2 years ago

can you post a quick reproducer? i checked the nested-layouts demo in the folder and it looks ok?

semrola commented 2 years ago

I figured out a different way to specify a layout. For now it works ok.

{
    applyDefaultStyles: true,
    stateManagement__enabled: true,
    center__paneSelector: ".c-pane",
    north__paneSelector: ".n-pane",
    north__minSize: 100,
    north__size: 300,
    north__children: {
        name: 'inner',
        applyDefaultStyles: true,
        west__minSize: 100,
        west__maxSize: 300,
        west__paneSelector: ".n-west",
        center__paneSelector: ".n-center",
        stateManagement__enabled: true
    }
}