Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor() {
this._sideBar = new TabBarSvg({
kind: 'sideBar',
insertBehavior: 'none',
removeBehavior: 'none',
allowDeselect: true
});
this._stackedPanel = new StackedPanel();
this._sideBar.hide();
this._stackedPanel.hide();
this._lastCurrent = null;
this._sideBar.currentChanged.connect(this._onCurrentChanged, this);
this._sideBar.tabActivateRequested.connect(
this._onTabActivateRequested,
this
);
this._stackedPanel.widgetRemoved.connect(this._onWidgetRemoved, this);
}
activate: (
app: JupyterFrontEnd,
labShell: ILabShell | null,
restorer: ILayoutRestorer | null
): void => {
const { shell } = app;
const tabs = new TabBarSvg({
kind: 'tabManager',
orientation: 'vertical'
});
const header = document.createElement('header');
if (restorer) {
restorer.add(tabs, 'tab-manager');
}
tabs.id = 'tab-manager';
tabs.title.iconClass = 'jp-TabIcon jp-SideBar-tabIcon';
tabs.title.caption = 'Open Tabs';
header.textContent = 'Open Tabs';
tabs.node.insertBefore(header, tabs.contentNode);
shell.add(tabs, 'left', { rank: 600 });