diff options
| author | Tyler Schicke <tyler_schicke@brown.edu> | 2019-07-10 15:29:02 -0400 |
|---|---|---|
| committer | Tyler Schicke <tyler_schicke@brown.edu> | 2019-07-10 15:29:02 -0400 |
| commit | 5615c1cb2fc62b89901a419c39d8a02754ff1d69 (patch) | |
| tree | 1f8879d757858bf7545dc62cfae15196dcb9f6f8 /src/client/views/collections | |
| parent | 36cd0866a139d10285b29d810b94bf03c259d85f (diff) | |
| parent | ee7eb826618af78e901db90f7cd28a0f1d45517d (diff) | |
Merge branch 'master' of github-tsch-brown:browngraphicslab/Dash-Web
Diffstat (limited to 'src/client/views/collections')
| -rw-r--r-- | src/client/views/collections/CollectionSchemaView.tsx | 2 | ||||
| -rw-r--r-- | src/client/views/collections/CollectionStackingView.tsx | 7 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx index b54e8aff0..148711c97 100644 --- a/src/client/views/collections/CollectionSchemaView.tsx +++ b/src/client/views/collections/CollectionSchemaView.tsx @@ -405,6 +405,7 @@ interface CollectionSchemaPreviewProps { renderDepth: number; width: () => number; height: () => number; + showOverlays?: (doc: Doc) => { title?: boolean, caption?: boolean }; CollectionView?: CollectionView | CollectionPDFView | CollectionVideoView; getTransform: () => Transform; addDocument: (document: Doc, allowDuplicates?: boolean) => boolean; @@ -488,6 +489,7 @@ export class CollectionSchemaPreview extends React.Component<CollectionSchemaPre fitToBox={this.props.fitToBox} renderDepth={this.props.renderDepth + 1} selectOnLoad={false} + showOverlays={this.props.showOverlays} addDocument={this.props.addDocument} removeDocument={this.props.removeDocument} moveDocument={this.props.moveDocument} diff --git a/src/client/views/collections/CollectionStackingView.tsx b/src/client/views/collections/CollectionStackingView.tsx index aea74321e..e6a3e8b68 100644 --- a/src/client/views/collections/CollectionStackingView.tsx +++ b/src/client/views/collections/CollectionStackingView.tsx @@ -12,6 +12,7 @@ import "./CollectionStackingView.scss"; import { CollectionSubView } from "./CollectionSubView"; import { undoBatch } from "../../util/UndoManager"; import { DragManager } from "../../util/DragManager"; +import { DocTypes } from "../../documents/Documents"; @observer export class CollectionStackingView extends CollectionSubView(doc => doc) { @@ -61,6 +62,10 @@ export class CollectionStackingView extends CollectionSubView(doc => doc) { this.createDropTarget(ele!); } + overlays = (doc: Doc) => { + return doc.type === DocTypes.IMG ? { title: true, caption: true } : {} + } + @computed get singleColumnChildren() { return this.filteredChildren.map((d, i) => { @@ -75,6 +80,7 @@ export class CollectionStackingView extends CollectionSubView(doc => doc) { <CollectionSchemaPreview Document={layoutDoc} DataDocument={d !== this.props.DataDoc ? this.props.DataDoc : undefined} + showOverlays={this.overlays} renderDepth={this.props.renderDepth} width={width} height={height} @@ -122,6 +128,7 @@ export class CollectionStackingView extends CollectionSubView(doc => doc) { addDocument={this.props.addDocument} moveDocument={this.props.moveDocument} removeDocument={this.props.removeDocument} + showOverlays={this.overlays} getTransform={dxf} width={width} height={height} |
