Class: TabManager

TabManager()

Tab Manager - Handles tab switching and state management

Constructor

new TabManager()

Source:

Methods

addTab(tabId, tabName, content, optionsopt) → {boolean}

Add a new tab programmatically

.

Add a new tab programmatically

Parameters:
Name Type Attributes Description
tabId string

Unique ID for the tab

tabName string

Display name for the tab

content HTMLElement

The content element to show when tab is active

options Object <optional>

Additional options

Properties
Name Type Attributes Default Description
activate boolean <optional>
true

Whether to activate the tab after adding it

icon string <optional>

Optional icon class for the tab

Source:
Returns:

True if the tab was added successfully, false otherwise

Type
boolean

getActiveTabContent() → {HTMLElement|null}

Get the DOM element of the currently active tab content

.

Get the DOM element of the currently active tab content

Source:
Returns:

The active tab content element or null if none is active

Type
HTMLElement | null

getCurrentTab() → {string}

Get the currently active tab

.

Get the currently active tab

Source:
Returns:

The ID of the currently active tab

Type
string

getTabs() → {Array}

Get all registered tabs

.

Get all registered tabs

Source:
Returns:

Array of tab objects with id, button, and content properties

Type
Array

init()

Initialize the tab manager

.

Initialize the tab manager

Source:

switchTab(tabId, forceopt) → {boolean}

Switch to a specific tab

.

Switch to a specific tab

Parameters:
Name Type Attributes Default Description
tabId string

The ID of the tab to switch to

force boolean <optional>
false

Force the tab switch even if it's already active

Source:
Returns:
  • Returns true if the tab switch was successful, false otherwise
Type
boolean