diff options
| author | Monika Hedman <monika_hedman@brown.edu> | 2019-03-16 18:48:21 -0400 |
|---|---|---|
| committer | Monika Hedman <monika_hedman@brown.edu> | 2019-03-16 18:48:21 -0400 |
| commit | 3101134e8e579a6f9202d552c46d2a8bd70fda79 (patch) | |
| tree | 1c582a510af7127406cac7516308a1896e4c1bc8 /src/client/views/collections/CollectionFreeFormView.tsx | |
| parent | 914114aaffbbd492f68c5e580acf6a28f43dc2c7 (diff) | |
cant get image stuff????
Diffstat (limited to 'src/client/views/collections/CollectionFreeFormView.tsx')
| -rw-r--r-- | src/client/views/collections/CollectionFreeFormView.tsx | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/client/views/collections/CollectionFreeFormView.tsx b/src/client/views/collections/CollectionFreeFormView.tsx index a94539312..79ea77c77 100644 --- a/src/client/views/collections/CollectionFreeFormView.tsx +++ b/src/client/views/collections/CollectionFreeFormView.tsx @@ -31,6 +31,7 @@ import { MarqueeView } from "./MarqueeView"; import { PreviewCursor } from "./PreviewCursor"; import React = require("react"); const JsxParser = require('react-jsx-parser').default;//TODO Why does this need to be imported like this? +import { ImageField } from '../../../fields/ImageField'; @observer export class CollectionFreeFormView extends CollectionViewBase { @@ -208,7 +209,27 @@ export class CollectionFreeFormView extends CollectionViewBase { @action onDrop = (e: React.DragEvent): void => { var pt = this.getTransform().transformPoint(e.pageX, e.pageY); - super.onDrop(e, { x: pt[0], y: pt[1] }); + + let text = e.dataTransfer.getData("text/plain"); + let start = text.startsWith("<div") + if (start) { + console.log(e.target); + console.log(this.props.Document.GetData(KeyStore.Layout, TextField, new String)) + var children = this.props.Document.GetList<Document>(KeyStore.Data, []); + console.log(children); + if (children) { + children.forEach(f => { + console.log(f.GetData(KeyStore.Layout, TextField, new String)); + }); + } + // let xx = this.props.Document.GetT(KeyStore.Thumbnail, ImageField) + // if (xx) { + // console.log(xx.toString()) + // } + this.props.Document.SetData(KeyStore.Layout, text, TextField); + e.stopPropagation(); + } + else { super.onDrop(e, { x: pt[0], y: pt[1] }); } } onDragOver = (): void => { |
