diff options
| author | Bob Zeleznik <zzzman@gmail.com> | 2019-04-23 01:14:45 -0400 |
|---|---|---|
| committer | Bob Zeleznik <zzzman@gmail.com> | 2019-04-23 01:14:45 -0400 |
| commit | 448a62581fbbad3af8073a195ca45aba2270d239 (patch) | |
| tree | 845e3e932f73ea449cb5c8fa874eaacac4fe90e4 /src/client/views/collections/CollectionBaseView.tsx | |
| parent | 6c5491b9c72650ae020a686753af3df74dfd87fb (diff) | |
right btn option for mac and windows.
Diffstat (limited to 'src/client/views/collections/CollectionBaseView.tsx')
| -rw-r--r-- | src/client/views/collections/CollectionBaseView.tsx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/client/views/collections/CollectionBaseView.tsx b/src/client/views/collections/CollectionBaseView.tsx index b19f01350..9ae2993be 100644 --- a/src/client/views/collections/CollectionBaseView.tsx +++ b/src/client/views/collections/CollectionBaseView.tsx @@ -93,15 +93,17 @@ export class CollectionBaseView extends React.Component<CollectionViewProps> { if (curPage >= 0) { doc.SetOnPrototype(KeyStore.AnnotationOn, this.props.Document); } - this.props.Document.GetOrCreateAsync(this.props.fieldKey, ListField, (value: ListField<Document>) => { - if (value && !this.createsCycle(doc, this.props.Document)) { + if (!this.createsCycle(doc, this.props.Document)) { + doc.SetNumber(KeyStore.ZoomBasis, this.props.Document.GetNumber(KeyStore.Scale, 1)); + let value = this.props.Document.Get(this.props.fieldKey) as ListField<Document>; + if (value) { if (!value.Data.some(v => v.Id === doc.Id) || allowDuplicates) { value.Data.push(doc); - doc.SetNumber(KeyStore.ZoomBasis, this.props.Document.GetNumber(KeyStore.Scale, 1)); } - return true; + } else { + this.props.Document.Set(this.props.fieldKey, new ListField([doc])); } - }); + } return true; // bcz: What is this code trying to do? // else { |
