aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionMasonryViewFieldRow.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/collections/CollectionMasonryViewFieldRow.tsx')
-rw-r--r--src/client/views/collections/CollectionMasonryViewFieldRow.tsx11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/client/views/collections/CollectionMasonryViewFieldRow.tsx b/src/client/views/collections/CollectionMasonryViewFieldRow.tsx
index 996626575..89ccf5a0f 100644
--- a/src/client/views/collections/CollectionMasonryViewFieldRow.tsx
+++ b/src/client/views/collections/CollectionMasonryViewFieldRow.tsx
@@ -5,7 +5,6 @@ import * as React from 'react';
import { returnEmptyString, returnFalse, setupMoveUpEvents } from '../../../ClientUtils';
import { emptyFunction, numberRange } from '../../../Utils';
import { Doc } from '../../../fields/Doc';
-import { DocData } from '../../../fields/DocSymbols';
import { PastelSchemaPalette, SchemaHeaderField } from '../../../fields/SchemaHeaderField';
import { ScriptField } from '../../../fields/ScriptField';
import { Docs } from '../../documents/Documents';
@@ -23,7 +22,7 @@ import './CollectionStackingView.scss';
interface CMVFieldRowProps {
rows: () => number;
headings: () => object[];
- Document: Doc;
+ Doc: Doc;
chromeHidden?: boolean;
heading: string;
headingObject: SchemaHeaderField | undefined;
@@ -74,7 +73,7 @@ export class CollectionMasonryViewFieldRow extends ObservableReactComponent<CMVF
createRowDropRef = (ele: HTMLDivElement | null) => {
this._dropDisposer?.();
- if (ele) this._dropDisposer = DragManager.MakeDropTarget(ele, this.rowDrop.bind(this), this._props.Document);
+ if (ele) this._dropDisposer = DragManager.MakeDropTarget(ele, this.rowDrop.bind(this), this._props.Doc);
else if (this._ele) this.props.refList.splice(this.props.refList.indexOf(this._ele), 1);
this._ele = ele;
};
@@ -164,7 +163,7 @@ export class CollectionMasonryViewFieldRow extends ObservableReactComponent<CMVF
const { pivotField } = this._props;
const newDoc = Docs.Create.TextDocument(value, { _layout_autoHeight: true, _width: 200, _layout_fitWidth: true, title: value });
DocumentView.SetSelectOnLoad(newDoc);
- pivotField && (newDoc[DocData][pivotField] = this.getValue(this._props.heading));
+ pivotField && (newDoc['$' + pivotField] = this.getValue(this._props.heading));
const docs = this._props.parent.childDocList;
return docs ? !!docs.splice(0, 0, newDoc) : this._props.parent._props.addDocument?.(newDoc) || false; // should really extend addDocument to specify insertion point (at beginning of list)
};
@@ -190,7 +189,7 @@ export class CollectionMasonryViewFieldRow extends ObservableReactComponent<CMVF
};
headerMove = (e: PointerEvent) => {
- const embedding = Doc.MakeEmbedding(this._props.Document);
+ const embedding = Doc.MakeEmbedding(this._props.Doc);
const key = this._props.pivotField;
let value = this.getValue(this.heading);
value = typeof value === 'string' ? `"${value}"` : value;
@@ -290,7 +289,7 @@ export class CollectionMasonryViewFieldRow extends ObservableReactComponent<CMVF
const key = this._props.pivotField;
const evContents = this.heading ? this.heading : this._props.type && this._props.type === 'number' ? '0' : `NO ${key.toUpperCase()} VALUE`;
const editableHeaderView = <EditableView GetValue={() => evContents} SetValue={this.headingChanged} contents={evContents} oneLine />;
- return this._props.Document.miniHeaders ? (
+ return this._props.Doc.miniHeaders ? (
<div className="collectionStackingView-miniHeader">{editableHeaderView}</div>
) : !this._props.headingObject ? null : (
<div className="collectionStackingView-sectionHeader" ref={this._headerRef}>