feat: add sortings
This commit is contained in:
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user