UBERF-8316 Documents drag and drop (#6769)

Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
Alexander Onnikov
2024-10-02 18:00:38 +07:00
committed by GitHub
parent 810a75067d
commit 8a8f56fda4
20 changed files with 510 additions and 97 deletions
@@ -21,6 +21,7 @@
import { createEventDispatcher } from 'svelte'
import document from '../plugin'
import TeamspacePresenter from './teamspace/TeamspacePresenter.svelte'
import { moveDocument } from '../utils'
export let value: Document
@@ -40,10 +41,7 @@
async function save (): Promise<void> {
const ops = client.apply(value._id)
await ops.update(value, {
space,
attachedTo: parent ?? document.ids.NoParent
})
await moveDocument(value, space, parent ?? document.ids.NoParent)
if (space !== value.space) {
const children = await findChildren(value)