Host Tabs

Host tabs for multi-surface editors.

Access:

app.hostTabs
app.getModule('hostTabs')
app.invoke('hostTabs.method', …)

isEnabled#

Returns whether host tabs UI is mounted.

Returns: boolean

app.hostTabs.isEnabled();

getActive#

Returns key of the currently active tab.

Returns: string

app.hostTabs.getActive();

setTab#

Creates or updates a non-editor tab with HTML content.

Parameters:

  • params (object) — tab fields: key, title / label, html, optional mode, permanent, activate

Returns: boolean

app.hostTabs.setTab({ key: 'report', title: 'Report', html, activate: true });
app.hostTabs.setTab({ key: 'summary', title: 'Summary', html, permanent: true });

setContent#

Updates HTML content of an existing tab.

Parameters:

  • key (string) — lookup key
  • html (string) — HTML string

Returns: boolean

app.hostTabs.setContent('report', '<p>...</p>');

removeTab#

Removes a tab and switches to editor if it was active. Does nothing (returns false) for the editor tab or tabs with permanent: true.

Parameters:

  • key (string) — lookup key

Returns: boolean

app.hostTabs.removeTab('report');

setActive#

Activates a tab by key and clears editor selection/focus.

Parameters:

  • key (string) — lookup key

Returns: boolean

app.hostTabs.setActive('editor');