diff options
| author | Lionel Han <47760119+IGoByJoe@users.noreply.github.com> | 2020-06-15 19:27:59 -0700 |
|---|---|---|
| committer | Lionel Han <47760119+IGoByJoe@users.noreply.github.com> | 2020-06-15 19:27:59 -0700 |
| commit | 099a1942440efc2784bc9b2c5896777cf85842ec (patch) | |
| tree | 56a598398fab001fb6625e20fb8c9797f71c733d /src/client/views/nodes/DocHolderBox.tsx | |
| parent | 3cb0b3aac05d9525d6deb4683328ce1309beee32 (diff) | |
| parent | 163e1f579d5a6b111645953b12e665839694585c (diff) | |
pull from master and cleaning up code
Diffstat (limited to 'src/client/views/nodes/DocHolderBox.tsx')
| -rw-r--r-- | src/client/views/nodes/DocHolderBox.tsx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/client/views/nodes/DocHolderBox.tsx b/src/client/views/nodes/DocHolderBox.tsx index 0c5239d66..a4c4663dd 100644 --- a/src/client/views/nodes/DocHolderBox.tsx +++ b/src/client/views/nodes/DocHolderBox.tsx @@ -198,11 +198,10 @@ export class DocHolderBox extends ViewBoxAnnotatableComponent<FieldViewProps, Do @undoBatch @action drop = (e: Event, de: DragManager.DropEvent) => { - if (de.complete.docDragData) { - if (de.complete.docDragData.draggedDocuments[0].type === DocumentType.FONTICON) { - const doc = Cast(de.complete.docDragData.draggedDocuments[0].dragFactory, Doc, null); - this.layoutDoc.childLayoutTemplate = doc; - } + const docDragData = de.complete.docDragData; + if (docDragData?.draggedDocuments[0].type === DocumentType.FONTICON) { + const doc = Cast(docDragData.draggedDocuments[0].dragFactory, Doc, null); + this.layoutDoc.childLayoutTemplate = doc; } } protected createDropTarget = (ele: HTMLDivElement) => { |
