diff options
author | James Hu <51237606+jameshu111@users.noreply.github.com> | 2023-07-06 11:21:48 -0400 |
---|---|---|
committer | James Hu <51237606+jameshu111@users.noreply.github.com> | 2023-07-06 11:21:48 -0400 |
commit | 5379662bdc9279e43d35166ce8bafe042d0d7fb6 (patch) | |
tree | 53d474435e772d0652b7ac321224b21c89dbcaad /src/client/views/DocComponent.tsx | |
parent | abeda176df59157f3194dd86966725f6193997c6 (diff) | |
parent | e4ad92e7300ee7844a514379c8a01d0f01cb3a59 (diff) |
Merge branch 'master' into james-azure-image
Diffstat (limited to 'src/client/views/DocComponent.tsx')
-rw-r--r-- | src/client/views/DocComponent.tsx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/views/DocComponent.tsx b/src/client/views/DocComponent.tsx index db24229dc..70d208a0b 100644 --- a/src/client/views/DocComponent.tsx +++ b/src/client/views/DocComponent.tsx @@ -172,8 +172,8 @@ export function ViewBoxAnnotatableComponent<P extends ViewBoxAnnotatableProps>() return true; } const first = doc instanceof Doc ? doc : doc[0]; - if (!first?._stayInCollection && addDocument !== returnFalse) { - return UndoManager.RunInTempBatch(() => this.removeDocument(doc, annotationKey, true) && addDocument(doc, annotationKey)); + if (!first?._dragOnlyWithinContainer && addDocument !== returnFalse) { + return this.removeDocument(doc, annotationKey, false) && addDocument(doc, annotationKey); } return false; }; @@ -213,14 +213,14 @@ export function ViewBoxAnnotatableComponent<P extends ViewBoxAnnotatableProps>() .map(doc => { // only make a pushpin if we have acl's to edit the document //DocUtils.LeavePushpin(doc); - doc._stayInCollection = undefined; + doc._dragOnlyWithinContainer = undefined; doc.embedContainer = this.props.Document; if (annotationKey ?? this._annotationKeySuffix()) Doc.GetProto(doc).annotationOn = this.rootDoc; Doc.ActiveDashboard && inheritParentAcls(Doc.ActiveDashboard, doc); }); const annoDocs = targetDataDoc[annotationKey ?? this.annotationKey] as List<Doc>; - if (annoDocs instanceof List) annoDocs.push(...added); + if (annoDocs instanceof List) annoDocs.push(...added.filter(add => !annoDocs.includes(add))); else targetDataDoc[annotationKey ?? this.annotationKey] = new List<Doc>(added); targetDataDoc[(annotationKey ?? this.annotationKey) + '_modificationDate'] = new DateField(new Date(Date.now())); } |