aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/presentationview
diff options
context:
space:
mode:
authorMohammad Amoush <47069173+mamoush34@users.noreply.github.com>2020-01-19 15:15:53 +0300
committerMohammad Amoush <47069173+mamoush34@users.noreply.github.com>2020-01-19 15:15:53 +0300
commit7683e1fbb53fe683c0d04e537d89fb53d768e852 (patch)
treed81eebcd5a129550a49fdfc852b8bb6220907a1a /src/client/views/presentationview
parentf4382d73eec75f7d7f4bfe6eae3fb1efa128a021 (diff)
parentaff9cc02750eb032ade98d77cf9ff45677063fc8 (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into webcam_mohammad
Diffstat (limited to 'src/client/views/presentationview')
-rw-r--r--src/client/views/presentationview/PresElementBox.tsx23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/client/views/presentationview/PresElementBox.tsx b/src/client/views/presentationview/PresElementBox.tsx
index 7a1b4f9fb..c02042380 100644
--- a/src/client/views/presentationview/PresElementBox.tsx
+++ b/src/client/views/presentationview/PresElementBox.tsx
@@ -9,11 +9,11 @@ import { documentSchema } from '../../../new_fields/documentSchemas';
import { Id } from "../../../new_fields/FieldSymbols";
import { createSchema, makeInterface } from '../../../new_fields/Schema';
import { Cast, NumCast, StrCast } from "../../../new_fields/Types";
-import { emptyFunction, returnFalse } from "../../../Utils";
+import { emptyFunction, returnFalse, emptyPath } from "../../../Utils";
import { DocumentType } from "../../documents/DocumentTypes";
import { Transform } from "../../util/Transform";
import { CollectionViewType } from '../collections/CollectionView';
-import { CollectionSchemaPreview } from '../collections/CollectionSchemaView';
+import { ContentFittingDocumentView } from '../nodes/ContentFittingDocumentView';
import { DocComponent } from '../DocComponent';
import { FieldView, FieldViewProps } from '../nodes/FieldView';
import "./PresElementBox.scss";
@@ -161,18 +161,18 @@ export class PresElementBox extends DocComponent<FieldViewProps, PresDocument>(P
return (null);
}
- let propDocWidth = NumCast(this.layoutDoc.nativeWidth);
- let propDocHeight = NumCast(this.layoutDoc.nativeHeight);
- let scale = () => 175 / NumCast(this.layoutDoc.nativeWidth, 175);
+ const propDocWidth = NumCast(this.layoutDoc.nativeWidth);
+ const propDocHeight = NumCast(this.layoutDoc.nativeHeight);
+ const scale = () => 175 / NumCast(this.layoutDoc.nativeWidth, 175);
return (
<div className="presElementBox-embedded" style={{
height: propDocHeight === 0 ? NumCast(this.layoutDoc.height) - NumCast(this.layoutDoc.collapsedHeight) : propDocHeight * scale(),
width: propDocWidth === 0 ? "auto" : propDocWidth * scale(),
}}>
- <CollectionSchemaPreview
- fitToBox={StrCast(this.targetDoc.type).indexOf(DocumentType.COL) !== -1}
+ <ContentFittingDocumentView
Document={this.targetDoc}
- fieldKey={this.props.fieldKey}
+ LibraryPath={emptyPath}
+ fitToBox={StrCast(this.targetDoc.type).indexOf(DocumentType.COL) !== -1}
addDocument={returnFalse}
removeDocument={returnFalse}
ruleProvider={undefined}
@@ -180,7 +180,6 @@ export class PresElementBox extends DocComponent<FieldViewProps, PresDocument>(P
pinToPres={returnFalse}
PanelWidth={() => this.props.PanelWidth() - 20}
PanelHeight={() => 100}
- setPreviewScript={emptyFunction}
getTransform={Transform.Identity}
active={this.props.active}
moveDocument={this.props.moveDocument!}
@@ -194,9 +193,9 @@ export class PresElementBox extends DocComponent<FieldViewProps, PresDocument>(P
}
render() {
- let treecontainer = this.props.ContainingCollectionDoc && this.props.ContainingCollectionDoc.viewType === CollectionViewType.Tree;
- let className = "presElementBox-item" + (this.currentIndex === this.indexInPres ? " presElementBox-selected" : "");
- let pbi = "presElementBox-interaction";
+ const treecontainer = this.props.ContainingCollectionDoc && this.props.ContainingCollectionDoc.viewType === CollectionViewType.Tree;
+ const className = "presElementBox-item" + (this.currentIndex === this.indexInPres ? " presElementBox-selected" : "");
+ const pbi = "presElementBox-interaction";
return (
<div className={className} key={this.props.Document[Id] + this.indexInPres}
style={{ outlineWidth: Doc.IsBrushed(this.targetDoc) ? `1px` : "0px", }}