From 54371ab69c87eb6b802f83cc311e3ef7900c4d65 Mon Sep 17 00:00:00 2001 From: Bob Zeleznik Date: Sun, 17 Mar 2019 23:09:50 -0400 Subject: from last --- src/client/views/collections/CollectionViewBase.tsx | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'src/client/views/collections/CollectionViewBase.tsx') 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 if (de.data["alias"] && dropDoc) { let oldDoc = dropDoc; de.data["document"] = dropDoc = oldDoc.CreateAlias(); - oldDoc.GetTAsync(KeyStore.Width, NumberField, (f: Opt) => { - if (f) { - dropDoc.SetNumber(KeyStore.Width, f.Data) - } - }) - oldDoc.GetTAsync(KeyStore.Height, NumberField, (f: Opt) => { - if (f) { - dropDoc.SetNumber(KeyStore.Height, f.Data) - } - }) + [KeyStore.Width, KeyStore.Height].map(key => + oldDoc.GetTAsync(key, NumberField, (f: Opt) => { + 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) { -- cgit v1.2.3-70-g09d2