
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
@springernature/global-expander
Advanced tools
Frontend package for expanding a target when clicking a toggle
Click a trigger element to toggle the display of a unique target element.
import {expander} from 'global-expander/js';
expander(options);
<button id="button1" data-expander data-expander-target="#target1">Expander 1</button>
<div id="target1">Target 1</div>
For more flexibility you can use the Expander class directly:
const trigger = document.querySelector('.my-trigger');
const target = document.querySelector('.my-target');
const myExpander = new Expander(trigger, target, options);
myExpander.init();
Option | Default Value | Type | Description |
---|---|---|---|
TARGET_HIDE_CLASS | 'u-js-hide' | String | HTML class to be toggled on the target |
TRIGGER_OPEN_CLASS | - | String | HTML class to be toggled to the trigger |
TRIGGER_OPEN_LABEL | - | String | Text to set on the trigger when open |
CLOSE_ON_CLICKOFF | true | Boolean | Closes when you click outside of the target |
AUTOFOCUS | false | Boolean | Set focus on the first tabbable element inside the target (will highlight text if appropriate, e.g. input with value) |
The data attribute options are the same, but are lowercase and hyphenated (and strings where the option is a boolean):
data-expander-target-hide-class
data-expander-trigger-open-class
data-expander-trigger-open-label
data-expander-close-on-clickoff
data-expander-autofocus
Note: data attribute options will take precedence over any options set during initialisation.
FAQs
Frontend package for expanding a target when clicking a toggle
We found that @springernature/global-expander demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 14 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.