diff options
author | srichman333 <sarah_n_richman@brown.edu> | 2023-07-04 18:34:00 -0400 |
---|---|---|
committer | srichman333 <sarah_n_richman@brown.edu> | 2023-07-04 18:34:00 -0400 |
commit | 0fe82e37ba345a32ff4f9dcbb0052ce45595b58b (patch) | |
tree | 17591b121bf6e97747d0cf8986c26c611fadd67c /src/client/views/DocComponent.tsx | |
parent | 77b3e319233f05de64276d4d77ff4328aa850a28 (diff) | |
parent | 638a3ce3bcd4aa7287544be82d8d9d07ee963600 (diff) |
Merge branch 'master' into collaboration-sarah
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 aa8b145be..f3aa8451a 100644 --- a/src/client/views/DocComponent.tsx +++ b/src/client/views/DocComponent.tsx @@ -173,8 +173,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; }; @@ -227,7 +227,7 @@ 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; const parent = DocCast(doc.embedContainer); @@ -243,7 +243,7 @@ export function ViewBoxAnnotatableComponent<P extends ViewBoxAnnotatableProps>() }); 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())); } |