diff options
| author | Hannah Chow <hannah_chow@brown.edu> | 2019-03-05 18:10:45 -0500 |
|---|---|---|
| committer | Hannah Chow <hannah_chow@brown.edu> | 2019-03-05 18:10:45 -0500 |
| commit | 406ffebb6f38a67f829df094465ecf3bd5c37f03 (patch) | |
| tree | d055fc7f8034f658a4d858da61d54ff847078840 /src/client/views/nodes/DocumentView.tsx | |
| parent | e64667c09f72e69f8121039809b48167a1d55465 (diff) | |
underlying link structure set up
Diffstat (limited to 'src/client/views/nodes/DocumentView.tsx')
| -rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index d31441399..e69485b9a 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -20,6 +20,7 @@ import { KeyValueBox } from "./KeyValueBox" import { WebBox } from "../nodes/WebBox"; import "./DocumentView.scss"; import React = require("react"); +import { TextField } from "../../../fields/TextField"; const JsxParser = require('react-jsx-parser').default; //TODO Why does this need to be imported like this? @@ -109,7 +110,6 @@ export class DocumentView extends React.Component<DocumentViewProps> { } } } -<<<<<<< HEAD private dropDisposer?: DragManager.DragDropDisposer; protected createDropTarget = (ele: HTMLDivElement) => { @@ -137,8 +137,6 @@ export class DocumentView extends React.Component<DocumentViewProps> { } } -======= ->>>>>>> bb1d3120f11a47e9d493202c1003dae52bf6667f onPointerMove = (e: PointerEvent): void => { if (e.cancelBubble) { return; @@ -208,6 +206,10 @@ export class DocumentView extends React.Component<DocumentViewProps> { let destDoc: Document = this.props.Document; let linkDoc: Document = new Document(); + linkDoc.Set(KeyStore.Title, new TextField("New Link")); + linkDoc.Set(KeyStore.LinkDescription, new TextField("")); + linkDoc.Set(KeyStore.LinkTags, new TextField("Default")); + sourceDoc.GetOrCreateAsync(KeyStore.LinkedToDocs, ListField, field => { (field as ListField<Document>).Data.push(linkDoc) }); linkDoc.GetOrCreateAsync(KeyStore.LinkedToDocs, ListField, field => { (field as ListField<Document>).Data.push(destDoc) }); destDoc.GetOrCreateAsync(KeyStore.LinkedFromDocs, ListField, field => { (field as ListField<Document>).Data.push(linkDoc) }); |
