add the show header command to the command palette

This commit is contained in:
Jeewon Koo 2022-05-03 02:46:23 -05:00
parent 203af66943
commit 5701f9fc8c

View File

@ -481,12 +481,13 @@ const title: JupyterFrontEndPlugin<void> = {
const topVisibility: JupyterFrontEndPlugin<void> = {
id: '@jupyter-notebook/application-extension:top',
requires: [INotebookShell, ITranslator],
optional: [ISettingRegistry],
optional: [ISettingRegistry, ICommandPalette],
activate: (
app: JupyterFrontEnd<JupyterFrontEnd.IShell>,
notebookShell: INotebookShell,
translator: ITranslator,
settingRegistry: ISettingRegistry | null
settingRegistry: ISettingRegistry | null,
palette: ICommandPalette | null
) => {
const trans = translator.load('notebook');
const top = notebookShell.top;
@ -527,6 +528,10 @@ const topVisibility: JupyterFrontEndPlugin<void> = {
});
}
if (palette) {
palette.addItem({ command: CommandIDs.toggleTop, category: 'View' });
}
const onChanged = (): void => {
if (settingsOverride) {
return;