Ver código fonte

Update the tooltip plugin commands.

Afshin Darian 8 anos atrás
pai
commit
75f1992012
2 arquivos alterados com 11 adições e 8 exclusões
  1. 7 4
      src/tooltip/index.ts
  2. 4 4
      src/tooltip/plugin.ts

+ 7 - 4
src/tooltip/index.ts

@@ -6,10 +6,13 @@ export * from './widget';
 
 
 /**
- * The command ids used by the tooltip plugin.
+ * The command IDs used by the tooltip plugin.
  */
 export
-const cmdIds = {
-  launch: 'tooltip:launch',
-  remove: 'tooltip:remove'
+namespace CommandIDs {
+  export
+  const launch = 'tooltip:launch';
+
+  export
+  const remove = 'tooltip:remove';
 };

+ 4 - 4
src/tooltip/plugin.ts

@@ -30,7 +30,7 @@ import {
 } from '../rendermime';
 
 import {
-  cmdIds, TooltipModel, TooltipWidget
+  CommandIDs, TooltipModel, TooltipWidget
 } from './';
 
 
@@ -59,11 +59,11 @@ function activate(app: JupyterLab, consoles: IConsoleTracker, notebooks: INotebo
   let tooltip: TooltipWidget = null;
 
   // Add tooltip launch command.
-  registry.addCommand(cmdIds.launch, {
+  registry.addCommand(CommandIDs.launch, {
     execute: args => {
       // If a tooltip is open, remove it and return.
       if (tooltip) {
-        return app.commands.execute(cmdIds.remove, void 0);
+        return app.commands.execute(CommandIDs.remove, void 0);
       }
 
       const notebook = args['notebook'] as boolean;
@@ -109,7 +109,7 @@ function activate(app: JupyterLab, consoles: IConsoleTracker, notebooks: INotebo
   });
 
   // Add tooltip remove command.
-  registry.addCommand(cmdIds.remove, {
+  registry.addCommand(CommandIDs.remove, {
     execute: () => {
       if (!tooltip) {
         return;