New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@br0ken/simpletooltip

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@br0ken/simpletooltip - npm Package Compare versions

Comparing version 3.3.1 to 3.3.2

2

package.json

@@ -6,3 +6,3 @@ {

"license": "MIT",
"version": "3.3.1",
"version": "3.3.2",
"homepage": "https://github.com/BR0kEN-/simpleTooltip",

@@ -9,0 +9,0 @@ "description": "CSS tooltips with position control via JS.",

@@ -17,5 +17,6 @@ /**

* @typedef {Object} SimpleTooltip.Options
* @property {String} [title]
* @property {function(element: Element): Boolean} [hideIf]
* @property {string} [title]
* @property {function(element: Element): boolean} [hideIf]
* @property {('nw'|'north'|'ne'|'west'|'east'|'sw'|'south'|'se')} shift
* @property {boolean} destruct
*/

@@ -54,13 +55,10 @@

// Set handlers for all elements having tooltips.
hint.addEventListener('mouseover', function() {
hint.simpleTooltipHandler = function() {
if (typeof this.simpleTooltipHideIf === 'function') {
if (this.simpleTooltipHideIf(this)) {
this.removeAttribute(plugin.attrs.shift);
return;
}
else {
this.setAttribute(plugin.attrs.shift, this.simpleTooltipShift);
}
this.setAttribute(plugin.attrs.shift, this.simpleTooltipShift);
}

@@ -128,3 +126,6 @@

containers.css.innerHTML = style;
}, false);
};
// Set handlers for all elements having tooltips.
hint.addEventListener(plugin.event, hint.simpleTooltipHandler, false);
}

@@ -136,2 +137,3 @@

var plugin = {
event: 'mouseover',
shifts: ['nw', 'north', 'ne', 'west', 'east', 'sw', 'south', 'se'],

@@ -209,20 +211,22 @@ maxWidth: 300,

try {
options.title = options.title || element.getAttribute('title');
options.shift = plugin.shifts[
plugin.shifts.indexOf(options.shift || element.getAttribute(plugin.attrs.shift))
];
} catch (e) {
continue;
}
if (options.destruct) {
element.removeAttribute(plugin.attrs.shift);
element.removeEventListener(plugin.event, element.simpleTooltipHandler);
} else {
try {
options.title = options.title || element.getAttribute('title');
options.shift = plugin.shifts[
plugin.shifts.indexOf(options.shift || element.getAttribute(plugin.attrs.shift))
];
} catch (e) {
continue;
}
if (options.shift && options.title) {
if (typeof options.hideIf === 'function' && !options.hideIf(element)) {
if (options.shift && options.title) {
element.setAttribute(plugin.attrs.title, options.title);
element.setAttribute(plugin.attrs.shift, options.shift);
element.simpleTooltipHideIf = options.hideIf;
element.simpleTooltipShift = options.shift;
setup(element);
}
element.setAttribute(plugin.attrs.title, options.title);
element.simpleTooltipHideIf = options.hideIf;
element.simpleTooltipShift = options.shift;
setup(element);
}

@@ -229,0 +233,0 @@ }

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