瀏覽代碼

Clean up command palette commands/shortcuts, keeping activate only. (#3427)

Brian E. Granger 7 年之前
父節點
當前提交
2ab460e171
共有 2 個文件被更改,包括 2 次插入27 次删除
  1. 0 25
      packages/apputils-extension/src/palette.ts
  2. 2 2
      packages/shortcuts-extension/schema/plugin.json

+ 0 - 25
packages/apputils-extension/src/palette.ts

@@ -27,12 +27,6 @@ import {
 namespace CommandIDs {
   export
   const activate = 'apputils:activate-command-palette';
-
-  export
-  const hide = 'apputils:hide-command-palette';
-
-  export
-  const toggle = 'apputils:toggle-command-palette';
 }
 
 
@@ -102,25 +96,6 @@ function activatePalette(app: JupyterLab, restorer: ILayoutRestorer): ICommandPa
     label: 'Activate Command Palette'
   });
 
-  commands.addCommand(CommandIDs.hide, {
-    execute: () => {
-      if (!palette.isHidden) {
-        shell.collapseLeft();
-      }
-    },
-    label: 'Hide Command Palette'
-  });
-
-  commands.addCommand(CommandIDs.toggle, {
-    execute: () => {
-      if (palette.isHidden) {
-        return commands.execute(CommandIDs.activate, void 0);
-      }
-      return commands.execute(CommandIDs.hide, void 0);
-    },
-    label: 'Toggle Command Palette'
-  });
-
   palette.inputNode.placeholder = 'SEARCH';
 
   shell.addToLeftArea(palette);

+ 2 - 2
packages/shortcuts-extension/schema/plugin.json

@@ -31,10 +31,10 @@
       },
       "type": "object"
     },
-    "command-palette:toggle": {
+    "command-palette:activate": {
       "default": { },
       "properties": {
-        "command": { "default": "apputils:toggle-command-palette" },
+        "command": { "default": "apputils:activate-command-palette" },
         "keys": { "default": ["Accel Shift C"] },
         "selector": { "default": "body" }
       },