Minor cleanups

pull/6487/head
Jeremy Tuloup 3 years ago
parent 22089cd1ac
commit 73aafed7db

@ -28,8 +28,6 @@ import { DocumentWidget } from '@jupyterlab/docregistry';
import { IMainMenu } from '@jupyterlab/mainmenu';
import { INotebookTools } from '@jupyterlab/notebook';
import { ISettingRegistry } from '@jupyterlab/settingregistry';
import { ITranslator } from '@jupyterlab/translation';
@ -603,15 +601,14 @@ const topVisibility: JupyterFrontEndPlugin<void> = {
const sidebarVisibility: JupyterFrontEndPlugin<void> = {
id: '@jupyter-notebook/application-extension:sidebar',
requires: [INotebookShell, ITranslator],
optional: [IMainMenu, ICommandPalette, INotebookTools],
optional: [IMainMenu, ICommandPalette],
autoStart: true,
activate: (
app: JupyterFrontEnd<JupyterFrontEnd.IShell>,
notebookShell: INotebookShell,
translator: ITranslator,
menu: IMainMenu | null,
palette: ICommandPalette | null,
notebookTools: INotebookTools | null
palette: ICommandPalette | null
) => {
if (!sidePanelsEnabled()) {
return;
@ -619,7 +616,7 @@ const sidebarVisibility: JupyterFrontEndPlugin<void> = {
const trans = translator.load('notebook');
var sideBarMenu: SideBarPanel.sideBarMenu = {
const sideBarMenu: SideBarPanel.sideBarMenu = {
left: null,
right: null
};

@ -3,7 +3,7 @@
import { JupyterFrontEnd } from '@jupyterlab/application';
import { DocumentRegistry } from '@jupyterlab/docregistry';
import { closeIcon, LabIcon, ReactWidget } from '@jupyterlab/ui-components';
import { closeIcon } from '@jupyterlab/ui-components';
import { ArrayExt, find } from '@lumino/algorithm';
import { PromiseDelegate, Token } from '@lumino/coreutils';
@ -19,7 +19,6 @@ import {
StackedPanel,
Widget
} from '@lumino/widgets';
import React from 'react';
/**
* The Jupyter Notebook application shell token.
@ -420,22 +419,19 @@ export class SideBarHandler {
this._widgetPanel = new StackedPanel();
this._widgetPanel.widgetRemoved.connect(this._onWidgetRemoved, this);
const that = this;
const collapseIcon = React.createElement(
'div',
{
onClick: () => {
that.collapse();
that.hide();
}
},
LabIcon.resolveReact({
icon: closeIcon,
className: 'jp-SidePanel-collapse'
})
);
this._panel.addWidget(ReactWidget.create(collapseIcon));
const closeButton = document.createElement('button');
closeIcon.element({
container: closeButton,
height: '16px',
width: 'auto'
});
closeButton.onclick = () => {
this.collapse();
this.hide();
};
closeButton.className = 'jp-Button jp-SidePanel-collapse';
const icon = new Widget({ node: closeButton });
this._panel.addWidget(icon);
this._panel.addWidget(this._widgetPanel);
}

@ -17,10 +17,6 @@
| SideBar
|----------------------------------------------------------------------------*/
/* Left */
/* Right */
/* Stack panels */
#jp-right-stack,
@ -30,14 +26,6 @@
min-width: var(--jp-sidebar-min-width);
}
#jp-right-stack {
border-left: var(--jp-border-width) solid var(--jp-border-color1);
}
#jp-left-stack {
border-right: var(--jp-border-width) solid var(--jp-border-color1);
}
#jp-left-stack .jp-SidePanel-collapse,
#jp-right-stack .jp-SidePanel-collapse {
display: flex;
@ -48,6 +36,10 @@
justify-content: right;
}
#jp-right-stack .jp-SidePanel-collapse {
justify-content: left;
}
#jp-left-stack .lm-StackedPanel,
#jp-right-stack .lm-StackedPanel {
flex: 1 1 auto;

@ -337,8 +337,7 @@ const scrollOutput: JupyterFrontEndPlugin<void> = {
const notebookToolsWidget: JupyterFrontEndPlugin<void> = {
id: '@jupyter-notebook/notebook-extension:notebook-tools',
autoStart: true,
requires: [INotebookShell],
optional: [INotebookTools],
requires: [INotebookShell, INotebookTools],
activate: (
app: JupyterFrontEnd,
shell: INotebookShell,

Loading…
Cancel
Save