|
@@ -18,6 +18,11 @@ import {
|
|
|
*/
|
|
|
const TOOLTIP_CLASS = 'jp-ConsoleTooltip';
|
|
|
|
|
|
+/**
|
|
|
+ * A flag to indicate that event handlers are caught in the capture phase.
|
|
|
+ */
|
|
|
+const USE_CAPTURE = true;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* A tooltip widget for a console.
|
|
@@ -101,18 +106,18 @@ class ConsoleTooltip extends Widget {
|
|
|
* in the capture phase.
|
|
|
*/
|
|
|
protected onAfterAttach(msg: Message): void {
|
|
|
- window.addEventListener('keydown', this, true);
|
|
|
- window.addEventListener('mousedown', this, true);
|
|
|
- window.addEventListener('scroll', this, true);
|
|
|
+ window.addEventListener('keydown', this, USE_CAPTURE);
|
|
|
+ window.addEventListener('mousedown', this, USE_CAPTURE);
|
|
|
+ window.addEventListener('scroll', this, USE_CAPTURE);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Handle `before_detach` messages for the widget.
|
|
|
*/
|
|
|
protected onBeforeDetach(msg: Message): void {
|
|
|
- window.removeEventListener('keydown', this);
|
|
|
- window.removeEventListener('mousedown', this);
|
|
|
- window.removeEventListener('scroll', this);
|
|
|
+ window.removeEventListener('keydown', this, USE_CAPTURE);
|
|
|
+ window.removeEventListener('mousedown', this, USE_CAPTURE);
|
|
|
+ window.removeEventListener('scroll', this, USE_CAPTURE);
|
|
|
}
|
|
|
|
|
|
/**
|