Initial work on drag-and-drop

This commit is contained in:
Magnus Åhall 2026-06-14 14:36:28 +02:00
parent 1055404dc0
commit 61b0ba9ada
10 changed files with 514 additions and 8 deletions

View file

@ -422,6 +422,11 @@ export class Node {
getParent() {//{{{
return this._parent
}//}}}
moveToParent(newParentUUID) {// {{{
this.ParentUUID = newParentUUID
this.data.ParentUUID = newParentUUID
this._modified = true
}// }}}
isLastSibling() {//{{{
return this._sibling_after === null
}//}}}
@ -463,9 +468,10 @@ export class Node {
// When stored into database and ancestry was changed,
// the ancestry path could be interesting.
/*
const ancestors = await nodeStore.getNodeAncestry(this)
this.data.Ancestors = ancestors.map(a => a.get('Name')).reverse()
*/
/* The node history is a local store for node history.
* This could be provisioned from the server or cleared if
* deemed unnecessary.
@ -481,12 +487,17 @@ export class Node {
const history = nodeStore.nodesHistory.add(this)
// Updated node is added to the send queue to be stored on server.
const sendQueue = nodeStore.sendQueue.add(this)
// Updated node is saved to the primary node store.
const nodeStoreAdding = nodeStore.add([this])
return Promise.all([history, sendQueue, nodeStoreAdding])
console.log('waiting')
await Promise.all([history, sendQueue, nodeStoreAdding])
console.log('waiting done')
return
}//}}}
}