Add options
This commit is contained in:
parent
b39c7a36d5
commit
1ad5f6bb35
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@tp/tp-sortable",
|
"name": "@tp/tp-sortable",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "tp-sortable.js",
|
"main": "tp-sortable.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@ -13,7 +13,7 @@
|
|||||||
"author": "trading_peter",
|
"author": "trading_peter",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lit": "^2.2.0",
|
"lit": "^2.8.0",
|
||||||
"sortablejs": "^1.15.0"
|
"sortablejs": "^1.15.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,6 +52,8 @@ class TpSortable extends LitElement {
|
|||||||
firstUpdated() {
|
firstUpdated() {
|
||||||
this.sortable = Sortable.create(this.querySelector('[slot="list"]'), {
|
this.sortable = Sortable.create(this.querySelector('[slot="list"]'), {
|
||||||
animation: 150,
|
animation: 150,
|
||||||
|
draggable: this.selector,
|
||||||
|
handle: this.handle,
|
||||||
onSort: e => {
|
onSort: e => {
|
||||||
this.dispatchEvent(new CustomEvent('sorting-changed', { detail: e, bubbles: true, composed: true }));
|
this.dispatchEvent(new CustomEvent('sorting-changed', { detail: e, bubbles: true, composed: true }));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user