|
@@ -1,6 +1,10 @@
|
|
|
// Copyright (c) Jupyter Development Team.
|
|
|
// Distributed under the terms of the Modified BSD License.
|
|
|
|
|
|
+import {
|
|
|
+ Kernel
|
|
|
+} from '@jupyterlab/services';
|
|
|
+
|
|
|
import {
|
|
|
Message
|
|
|
} from 'phosphor/lib/core/messaging';
|
|
@@ -31,6 +35,7 @@ class TooltipWidget extends Widget {
|
|
|
constructor(options: TooltipWidget.IOptions) {
|
|
|
super();
|
|
|
this.editor = options.editor;
|
|
|
+ this.kernel = options.kernel;
|
|
|
this.addClass(TOOLTIP_CLASS);
|
|
|
}
|
|
|
|
|
@@ -39,13 +44,34 @@ class TooltipWidget extends Widget {
|
|
|
*/
|
|
|
readonly editor: CodeEditor.IEditor;
|
|
|
|
|
|
+ /**
|
|
|
+ * The kernel for the tooltip widget.
|
|
|
+ */
|
|
|
+ readonly kernel: Kernel.IKernel;
|
|
|
+
|
|
|
/**
|
|
|
* Handle `'activate-request'` messages.
|
|
|
*/
|
|
|
protected onActivateRequest(msg: Message): void {
|
|
|
+ console.log('activate-request');
|
|
|
this.node.tabIndex = -1;
|
|
|
this.node.focus();
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Handle `'after-attach'` messages.
|
|
|
+ */
|
|
|
+ protected onAfterAttach(msg: Message): void {
|
|
|
+ console.log('after-attach');
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Handle `'update-request'` messages.
|
|
|
+ */
|
|
|
+ protected onUpdateRequest(msg: Message): void {
|
|
|
+ console.log('update-request');
|
|
|
+ super.onUpdateRequest(msg);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -62,5 +88,10 @@ namespace TooltipWidget {
|
|
|
* The editor referent of the tooltip widget.
|
|
|
*/
|
|
|
editor: CodeEditor.IEditor;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * The kernel for the tooltip widget.
|
|
|
+ */
|
|
|
+ kernel: Kernel.IKernel;
|
|
|
}
|
|
|
}
|