diff options
author | bobzel <zzzman@gmail.com> | 2024-01-24 16:13:27 -0500 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2024-01-24 16:13:27 -0500 |
commit | c8be94244bcd094efba739e5a46034bceccea80f (patch) | |
tree | fa9648c3ecad6f9725173f0847d4ab0c26af234c /src/client/views/DocComponent.tsx | |
parent | af380979349308077e13fc12a2d09255b7f05f28 (diff) |
several fixes to drag/drop so that dropAction's set on target work for tree views, notetaking, formattedText, etc. make bringToFront an optional prop.
Diffstat (limited to 'src/client/views/DocComponent.tsx')
-rw-r--r-- | src/client/views/DocComponent.tsx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/views/DocComponent.tsx b/src/client/views/DocComponent.tsx index 0e5a4f013..e7469a37c 100644 --- a/src/client/views/DocComponent.tsx +++ b/src/client/views/DocComponent.tsx @@ -172,7 +172,7 @@ export function ViewBoxAnnotatableComponent<P extends FieldViewProps>() { } @action.bound - removeDocument(doc: Doc | Doc[], annotationKey?: string, leavePushpin?: boolean): boolean { + removeDocument(doc: Doc | Doc[], annotationKey?: string, leavePushpin?: boolean, dontAddToRemoved?: boolean): boolean { const effectiveAcl = GetEffectiveAcl(this.dataDoc); const indocs = doc instanceof Doc ? [doc] : doc; const docs = indocs.filter(doc => [AclEdit, AclAdmin].includes(effectiveAcl) || GetEffectiveAcl(doc) === AclAdmin); @@ -189,7 +189,7 @@ export function ViewBoxAnnotatableComponent<P extends FieldViewProps>() { Doc.RemoveDocFromList(targetDataDoc, annotationKey ?? this.annotationKey, doc); Doc.RemoveDocFromList(doc[DocData], 'proto_embeddings', doc); doc.embedContainer = undefined; - if (recent) { + if (recent && !dontAddToRemoved) { doc.type !== DocumentType.LOADING && Doc.AddDocToList(recent, 'data', doc, undefined, true, true); } }); @@ -214,7 +214,7 @@ export function ViewBoxAnnotatableComponent<P extends FieldViewProps>() { } const first = doc instanceof Doc ? doc : doc[0]; if (!first?._dragOnlyWithinContainer && addDocument !== returnFalse) { - return this.removeDocument(doc, annotationKey, false) && addDocument(doc, annotationKey); + return this.removeDocument(doc, annotationKey, false, true) && addDocument(doc, annotationKey); } return false; }; |