Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@jupyterlab/tooltip

Package Overview
Dependencies
Maintainers
6
Versions
386
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jupyterlab/tooltip - npm Package Compare versions

Comparing version 0.8.2 to 0.9.0

29

lib/widget.js

@@ -24,5 +24,5 @@ "use strict";

/**
* The class added to widgets that have spawned a tooltip and anchor it.
* The class added to the body when a tooltip exists on the page.
*/
var ANCHOR_CLASS = 'jp-Tooltip-anchor';
var BODY_CLASS = 'jp-mod-tooltip';
/**

@@ -52,10 +52,7 @@ * The minimum height of a tooltip widget.

var layout = _this.layout = new widgets_1.PanelLayout();
var model = new rendermime_1.MimeModel({ data: options.bundle });
_this.anchor = options.anchor;
_this.addClass(TOOLTIP_CLASS);
_this.anchor.addClass(ANCHOR_CLASS);
_this._editor = options.editor;
_this._rendermime = options.rendermime;
var model = new rendermime_1.MimeModel({
data: options.bundle
});
var mimeType = _this._rendermime.preferredMimeType(options.bundle, false);

@@ -74,5 +71,2 @@ if (!mimeType) {

Tooltip.prototype.dispose = function () {
if (this.anchor && !this.anchor.isDisposed) {
this.anchor.removeClass(ANCHOR_CLASS);
}
if (this._content) {

@@ -98,8 +92,7 @@ this._content.dispose();

}
var node = this.node;
var target = event.target;
switch (event.type) {
case 'keydown':
if (this.node.contains(event.target)) {
if (event.keyCode === 27) {
this.dispose();
}
if (node.contains(target)) {
return;

@@ -110,3 +103,3 @@ }

case 'mousedown':
if (this.node.contains(event.target)) {
if (node.contains(target)) {
this.activate();

@@ -135,2 +128,3 @@ return;

Tooltip.prototype.onAfterAttach = function (msg) {
document.body.classList.add(BODY_CLASS);
document.addEventListener('keydown', this, USE_CAPTURE);

@@ -145,2 +139,3 @@ document.addEventListener('mousedown', this, USE_CAPTURE);

Tooltip.prototype.onBeforeDetach = function (msg) {
document.body.classList.remove(BODY_CLASS);
document.removeEventListener('keydown', this, USE_CAPTURE);

@@ -178,2 +173,5 @@ document.removeEventListener('mousedown', this, USE_CAPTURE);

var line = editor.getLine(cursor.line);
if (!line) {
return;
}
var tokens = line.substring(0, end).split(/\W+/);

@@ -183,2 +181,5 @@ var last = tokens[tokens.length - 1];

var position = editor.getPositionAt(start);
if (!position) {
return;
}
var anchor = editor.getCoordinateForPosition(position);

@@ -185,0 +186,0 @@ var style = window.getComputedStyle(this.node);

{
"name": "@jupyterlab/tooltip",
"version": "0.8.2",
"version": "0.9.0",
"description": "JupyterLab - Tooltip Widget",

@@ -16,6 +16,6 @@ "main": "lib/index.js",

"dependencies": {
"@jupyterlab/apputils": "^0.8.2",
"@jupyterlab/codeeditor": "^0.8.1",
"@jupyterlab/rendermime": "^0.8.2",
"@jupyterlab/services": "^0.47.1",
"@jupyterlab/apputils": "^0.9.0",
"@jupyterlab/codeeditor": "^0.9.0",
"@jupyterlab/rendermime": "^0.9.0",
"@jupyterlab/services": "^0.48.0",
"@phosphor/coreutils": "^1.2.0",

@@ -22,0 +22,0 @@ "@phosphor/messaging": "^1.2.1",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc