2.2.5 • Published 1 year ago

draggable-list v2.2.5

Weekly downloads
4
License
ISC
Repository
github
Last release
1 year ago

draggable-list

Build
Status

This is a component, built using d3, that will take a html ul and make it sortable using drag and drop.

Code Example

As an object that emits move events

var List = require('draggable-list')
  , d3 = require('d3')

var list = new List(document.querySelector('.draggable-list')) // Pass in a node that should
                                                               // have dnd to sort
list.on('move', function (node, newIndex, prevIndex) {
  console.log(arguments)
})

Or using d3 conventions

var draggable = require('draggable-list')
  , d3 = require('d3')

d3.selectAll('.draggable-list')
  .call(draggable)

Elements can set a class of draggable-list-nodrag to prevent dnd operations on that element.

Elements can set a class of draggable-list-lock so the list item index is always maintained.

Installation

$ npm install draggable-list

Tests

$ npm test

License

ISC

2.2.3

1 year ago

2.2.5

1 year ago

2.2.4

1 year ago

2.2.1

1 year ago

2.2.2

1 year ago

2.2.0

1 year ago

1.4.3

2 years ago

2.1.1

2 years ago

1.4.2

2 years ago

2.1.0

2 years ago

2.0.0

2 years ago

1.4.1

6 years ago

1.4.0

7 years ago

1.3.1

7 years ago

1.3.0

7 years ago

1.2.6

7 years ago

1.2.5

8 years ago

1.2.4

8 years ago