swapSurfaces
- Less than a minute to read
Swaps two surfaces (pages) in the loaded product. This command is an equivalent of the swapSurfaces method of the IFrame API.
Params
lhsSurface
- the first surface (page) to swap.rhsSurface
- the second surface (page) to swap.
Example
Let's look at how you can swap the first page of the loaded product with the second page.
{
"type": "design-editor",
"name": "editor",
"params": {
"initial": { ... },
"swapSurfaces": [{
"lhsSurfaceIndex": 0,
"rhsSurfaceIndex": 1
}]
}
}