aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2019-03-17 23:09:50 -0400
committerBob Zeleznik <zzzman@gmail.com>2019-03-17 23:09:50 -0400
commit54371ab69c87eb6b802f83cc311e3ef7900c4d65 (patch)
tree0357c8a2beca18f522e9b150e5e2e5e3ad2863fc /src
parenta6ca5db7f43ee31965169ff8d6d0aaffa86dc74e (diff)
from last
Diffstat (limited to 'src')
-rw-r--r--src/client/views/collections/CollectionViewBase.tsx17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/client/views/collections/CollectionViewBase.tsx b/src/client/views/collections/CollectionViewBase.tsx
index 304c44788..37ec203b5 100644
--- a/src/client/views/collections/CollectionViewBase.tsx
+++ b/src/client/views/collections/CollectionViewBase.tsx
@@ -50,16 +50,13 @@ export class CollectionViewBase extends React.Component<SubCollectionViewProps>
if (de.data["alias"] && dropDoc) {
let oldDoc = dropDoc;
de.data["document"] = dropDoc = oldDoc.CreateAlias();
- oldDoc.GetTAsync(KeyStore.Width, NumberField, (f: Opt<NumberField>) => {
- if (f) {
- dropDoc.SetNumber(KeyStore.Width, f.Data)
- }
- })
- oldDoc.GetTAsync(KeyStore.Height, NumberField, (f: Opt<NumberField>) => {
- if (f) {
- dropDoc.SetNumber(KeyStore.Height, f.Data)
- }
- })
+ [KeyStore.Width, KeyStore.Height].map(key =>
+ oldDoc.GetTAsync(key, NumberField, (f: Opt<NumberField>) => {
+ if (f) {
+ dropDoc.SetNumber(key, f.Data)
+ }
+ })
+ );
} else {
const docView: DocumentView = de.data["documentView"];
if (docView && docView.props.RemoveDocument && docView.props.ContainingCollectionView !== this.props.CollectionView) {