浏览代码

show/hide only if something to show; wording

Ahmed Fasih 4 年之前
父节点
当前提交
87538fc306
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      packages/apputils-extension/src/index.ts

+ 4 - 2
packages/apputils-extension/src/index.ts

@@ -314,8 +314,10 @@ export const toggleHeader: JupyterFrontEndPlugin<void> = {
 
     const category: string = trans.__('Main Area');
     app.commands.addCommand(CommandIDs.toggleHeader, {
-      label: trans.__('Show Header'),
-      isEnabled: () => app.shell.currentWidget instanceof MainAreaWidget,
+      label: trans.__('Show Header Above Content'),
+      isEnabled: () =>
+        app.shell.currentWidget instanceof MainAreaWidget &&
+        app.shell.currentWidget.contentHeader.widgets.length > 0,
       isToggled: () => {
         const widget = app.shell.currentWidget;
         return widget instanceof MainAreaWidget