Workspace.on('layout-change') method
Workspace › on(‘layout-change’)
Official
Triggered when the layout of the workspace changes.Signature:
on(name: "layout-change", callback: () => unknown, ctx?: unknown): EventRefParameters:
| Parameter | Type | Description |
|---|---|---|
| name | "layout-change" | Should be 'layout-change'. |
| callback | () => unknown | The callback function. |
| ctx? | unknown | The context passed as this to the callback function. |
Returns: EventRef — The event reference.
Example:
app.workspace.on('layout-change', () => { console.log('layout-change');});