Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@eight04/draggable-list
Advanced tools
Readme
A tiny vanilla draggable list built with HTML5 drag-n-drop.
https://eight04.github.io/draggable-list/
npm
npm install draggable-list
unpkg
<!-- export to global variable "DraggableList" -->
<script src="https://unpkg.com/eight04/draggable-list/dist/draggable-list.iife.js"></script>
import DraggableList from "https://unpkg.com/eight04/draggable-list/dist/draggable-list.es.js";
const ul = document.querySelector("#demo1");
new DraggableList(ul);
Prebuilt dist is compiled with babel to support Chrome 55.
This module exports a default member.
new DraggableList(el: Element, {scrollContainer?: Element} = {})
Convert an element to a draggable list.
By default, the script calculates cursor position via MouseEvent.pageY
. This won't work if the list is inside a scrollable container. Specify scrollContainer
so it can also calculate scrollContainer.scrollTop
.
e = {
detail: {
origin: Event,
dragTarget: Element,
// for d:dragmove
startPos: {x, y},
currentPos: {x, y},
// for d:dragend
originalIndex: Number,
spliceIndex: Number,
dropped: Boolean,
insertBefore?: Element
}
}
origin
- the raw DragEvent
.dragTarget
- the target that is being dragged. The parent of dragTarget
is always the container.startPos
- mouse position relative to the page when drag starts.currentPos
- mouse position relative to the page when drag move.originalIndex
- the index of dragTarget
.spliceIndex
- the index that can be used for splice, after removing dragTarget
from the list.insertBefore
- the element that can be used as the anchor of Element.insertBefore
.dropped
- if false then the item is dropped outside the list or is canceled via Esc.0.3.0 (Dec 12, 2021)
scrollContainer
.0.2.0 (Dec 10, 2021)
0.1.0 (Dec 10, 2021)
FAQs
A tiny vanilla draggable list built with HTML5 drag-n-drop.
The npm package @eight04/draggable-list receives a total of 5 weekly downloads. As such, @eight04/draggable-list popularity was classified as not popular.
We found that @eight04/draggable-list demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.