feat: add sortings

This commit is contained in:
kwaroran
2024-06-06 19:29:38 +09:00
parent c5fb83e557
commit 57e50ca9b3
6 changed files with 72 additions and 22 deletions

View File

@@ -2,7 +2,7 @@
import type { customscript } from "src/ts/storage/database";
import RegexData from "./RegexData.svelte";
import Sortable from "sortablejs";
import { sleep } from "src/ts/util";
import { sleep, sortableOptions } from "src/ts/util";
import { onDestroy, onMount } from "svelte";
export let value:customscript[] = []
let stb: Sortable = null
@@ -25,7 +25,8 @@
sorted += 1
await sleep(1)
createStb()
}
},
...sortableOptions
})
}
@@ -37,12 +38,12 @@
}
const onClose = () => {
opened -= 1
// if(opened === 0){
// createStb()
// }
if(opened === 0){
createStb()
}
}
// onMount(createStb)
onMount(createStb)
onDestroy(() => {
if(stb){