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

@elvia/elvis-toolbox

Package Overview
Dependencies
Maintainers
4
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@elvia/elvis-toolbox - npm Package Compare versions

Comparing version 1.0.1 to 1.2.0

36

dist/elvis-toolbox.js

@@ -11,4 +11,38 @@ /*

const outlineListener = (element, destroy) => {
if (!element) {
return;
}
const addOutline = e => {
if (e.key === 'Tab' && element.classList.contains('ewc-no-outline')) {
element.classList.remove('ewc-no-outline'); // Add mousedown event-listener to remove outline again
element.addEventListener('mousedown', removeOutline, false);
}
};
const removeOutline = () => {
if (!element.classList.contains('ewc-no-outline')) {
element.classList.add('ewc-no-outline'); // Remove mousedown event-listener until next tab happens
element.removeEventListener('mousedown', removeOutline, false);
}
}; // If destroy is true -> Remove all listeners and return
if (destroy) {
element.removeEventListener('keydown', addOutline);
element.removeEventListener('mousedown', removeOutline, false);
return;
} // Start listening for keyboard-events and mousedown on element to add or remove outline
element.addEventListener('keydown', addOutline);
element.addEventListener('mousedown', removeOutline, false);
};
export default {
throttle: throttle
throttle: throttle,
outlineListener: outlineListener
};

2

package.json
{
"name": "@elvia/elvis-toolbox",
"version": "1.0.1",
"version": "1.2.0",
"description": "",

@@ -5,0 +5,0 @@ "main": "./dist/elvis-toolbox.js",

@@ -7,2 +7,35 @@ import * as lodashThrottle from 'lodash.throttle';

export default { throttle: throttle };
const outlineListener = (element: HTMLElement, destroy?: boolean): void => {
if (!element) {
return;
}
const addOutline = (e: KeyboardEvent) => {
if (e.key === 'Tab' && element.classList.contains('ewc-no-outline')) {
element.classList.remove('ewc-no-outline');
// Add mousedown event-listener to remove outline again
element.addEventListener('mousedown', removeOutline, false);
}
};
const removeOutline = () => {
if (!element.classList.contains('ewc-no-outline')) {
element.classList.add('ewc-no-outline');
// Remove mousedown event-listener until next tab happens
element.removeEventListener('mousedown', removeOutline, false);
}
};
// If destroy is true -> Remove all listeners and return
if (destroy) {
element.removeEventListener('keydown', addOutline);
element.removeEventListener('mousedown', removeOutline, false);
return;
}
// Start listening for keyboard-events and mousedown on element to add or remove outline
element.addEventListener('keydown', addOutline);
element.addEventListener('mousedown', removeOutline, false);
};
export default { throttle: throttle, outlineListener: outlineListener };
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