From 2e4f9609c5b508de255c3a4038305c79ef12b748 Mon Sep 17 00:00:00 2001
From: Bob Zeleznik <zzzman@gmail.com>
Date: Sun, 2 Feb 2020 00:16:33 -0500
Subject: trying hard

---
 src/client/views/collections/CollectionSubView.tsx | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

(limited to 'src/client/views/collections/CollectionSubView.tsx')

diff --git a/src/client/views/collections/CollectionSubView.tsx b/src/client/views/collections/CollectionSubView.tsx
index 9482435a0..0eeb1c83d 100644
--- a/src/client/views/collections/CollectionSubView.tsx
+++ b/src/client/views/collections/CollectionSubView.tsx
@@ -70,7 +70,10 @@ export function CollectionSubView<T>(schemaCtor: (doc: Doc) => T) {
                 (args) => {
                     const childLayout = Cast(this.props.Document.childLayout, Doc);
                     if (childLayout instanceof Doc) {
-                        this.childDocs.map(doc => Doc.ApplyTemplateTo(childLayout, doc, "layout_fromParent"));
+                        this.childDocs.map(doc => {
+                            doc.layout_fromParent = childLayout;
+                            doc.layoutKey = "layout_fromParent";
+                        });
                     }
                     else if (!(childLayout instanceof Promise)) {
                         this.childDocs.filter(d => !d.isTemplateForField).map(doc => doc.layoutKey === "layout_fromParent" && (doc.layoutKey = "layout"));
@@ -182,8 +185,10 @@ export function CollectionSubView<T>(schemaCtor: (doc: Doc) => T) {
                 this.props.Document.dropConverter.script.run({ dragData: docDragData }); /// bcz: check this 
             if (docDragData && !docDragData.applyAsTemplate) {
                 if (de.altKey && docDragData.draggedDocuments.length) {
-                    this.childDocs.map(doc =>
-                        Doc.ApplyTemplateTo(docDragData.draggedDocuments[0], doc, "layout_fromParent"));
+                    this.childDocs.map(doc => {
+                        doc.layout_fromParent = docDragData.draggedDocuments[0];
+                        doc.layoutKey = "layout_fromParent";
+                    });
                     e.stopPropagation();
                     return true;
                 }
-- 
cgit v1.2.3-70-g09d2

