aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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) {