From d82535102b94daef1877443b2bbde8e80c207faa Mon Sep 17 00:00:00 2001 From: Alex Waese-Perlman Date: Thu, 28 Jul 2022 18:36:46 +0300 Subject: [PATCH] Allow users to set activeTabset to undefined --- src/model/Actions.ts | 8 ++++++++ src/model/Model.ts | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/src/model/Actions.ts b/src/model/Actions.ts index e0be1c99..25b2b359 100755 --- a/src/model/Actions.ts +++ b/src/model/Actions.ts @@ -19,6 +19,7 @@ export class Actions { static UPDATE_NODE_ATTRIBUTES = "FlexLayout_UpdateNodeAttributes"; static FLOAT_TAB = "FlexLayout_FloatTab"; static UNFLOAT_TAB = "FlexLayout_UnFloatTab"; + static DESELECT_TABSET = "FlexLayout_DeselectTabset"; /** * Adds a tab node to the given tabset node @@ -165,4 +166,11 @@ export class Actions { static unFloatTab(nodeId: string): Action { return new Action(Actions.UNFLOAT_TAB, { node: nodeId }); } + + /** + * Deselect the active tab set, setting the active tabset to undefined + */ + static deselectTabset(): Action { + return new Action(Actions.DESELECT_TABSET, {}) + } } diff --git a/src/model/Model.ts b/src/model/Model.ts index 95cb2f13..1eebde70 100755 --- a/src/model/Model.ts +++ b/src/model/Model.ts @@ -395,6 +395,10 @@ export class Model { node._updateAttrs(action.data.json); break; } + case Actions.DESELECT_TABSET: { + this._activeTabSet = undefined; + break; + } default: break; }