diff options
author | Sam Wilkins <samuel_wilkins@brown.edu> | 2019-06-11 14:19:51 -0400 |
---|---|---|
committer | Sam Wilkins <samuel_wilkins@brown.edu> | 2019-06-11 14:19:51 -0400 |
commit | c0aa7c79258ea8409611da710dc802e3481c34d8 (patch) | |
tree | d1cfa06eaa26b768f7f31ff8a82282a423766e59 | |
parent | c789df5ae7a9e364f0d95b54f4a2f330b536a393 (diff) |
fixed the temporary inability to add documents :(
-rw-r--r-- | src/client/views/Templates.tsx | 18 | ||||
-rw-r--r-- | src/client/views/collections/CollectionBaseView.tsx | 2 | ||||
-rw-r--r-- | src/client/views/nodes/DocumentContentsView.tsx | 2 |
3 files changed, 11 insertions, 11 deletions
diff --git a/src/client/views/Templates.tsx b/src/client/views/Templates.tsx index df53284ed..e4a9258b7 100644 --- a/src/client/views/Templates.tsx +++ b/src/client/views/Templates.tsx @@ -39,20 +39,20 @@ export class Template { export namespace Templates { // export const BasicLayout = new Template("Basic layout", "{layout}"); - // export const Caption = new Template("Caption", TemplatePosition.OutterBottom, - // `<div> - // <div style="height:100%; width:100%;position:absolute;">{layout}</div> - // <div style="bottom: 0; font-size:14px; width:100%; position:absolute"> - // <FormattedTextBox {...props} fieldKey={"caption"} hideOnLeave={"true"} /> - // </div> - // </div>` ); - export const Caption = new Template("Caption", TemplatePosition.OutterBottom, `<div> <div style="height:100%; width:100%;position:absolute;">{layout}</div> - <DetailedCaptionToggle {...props}/> + <div style="bottom: 0; font-size:14px; width:100%; position:absolute"> + <FormattedTextBox {...props} fieldKey={"caption"} hideOnLeave={"true"} /> + </div> </div>` ); + // export const Caption = new Template("Caption", TemplatePosition.OutterBottom, + // `<div> + // <div style="height:100%; width:100%;position:absolute;">{layout}</div> + // <DetailedCaptionToggle {...props}/> + // </div>` ); + export const TitleOverlay = new Template("TitleOverlay", TemplatePosition.InnerTop, `<div> <div style="height:100%; width:100%;position:absolute;">{layout}</div> diff --git a/src/client/views/collections/CollectionBaseView.tsx b/src/client/views/collections/CollectionBaseView.tsx index a3019f23e..4d6721dc1 100644 --- a/src/client/views/collections/CollectionBaseView.tsx +++ b/src/client/views/collections/CollectionBaseView.tsx @@ -106,7 +106,7 @@ export class CollectionBaseView extends React.Component<CollectionViewProps> { } if (!this.createsCycle(doc, props.Document)) { //TODO This won't create the field if it doesn't already exist - const childDocs = DocListCast(props.Document[props.fieldKey]); + const childDocs = Cast(props.Document[props.fieldKey], listSpec(Doc)); let alreadyAdded = true; if (childDocs !== undefined) { // if this is not the first document added to the collection diff --git a/src/client/views/nodes/DocumentContentsView.tsx b/src/client/views/nodes/DocumentContentsView.tsx index b6c150854..27843d33a 100644 --- a/src/client/views/nodes/DocumentContentsView.tsx +++ b/src/client/views/nodes/DocumentContentsView.tsx @@ -104,7 +104,7 @@ export class DocumentContentsView extends React.Component<DocumentViewProps & { render() { if (!this.layout && (this.props.layoutKey !== "overlayLayout" || !this.templates.length)) return (null); return <ObserverJsxParser - components={{ DetailedCaptionToggle, FormattedTextBox, ImageBox, IconBox, FieldView, CollectionFreeFormView, CollectionDockingView, CollectionSchemaView, CollectionView, CollectionPDFView, CollectionVideoView, WebBox, KeyValueBox, PDFBox, VideoBox, AudioBox, HistogramBox }} + components={{ FormattedTextBox, ImageBox, IconBox, FieldView, CollectionFreeFormView, CollectionDockingView, CollectionSchemaView, CollectionView, CollectionPDFView, CollectionVideoView, WebBox, KeyValueBox, PDFBox, VideoBox, AudioBox, HistogramBox }} bindings={this.CreateBindings()} jsx={this.finalLayout} showWarnings={true} |