aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionMasonryViewFieldRow.tsx
diff options
context:
space:
mode:
authorGeireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>2020-11-06 00:32:16 +0800
committerGeireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>2020-11-06 00:32:16 +0800
commit13d1925c12539949f5bf26113f4c4599d9c98e7f (patch)
tree3bd9dc7e41834e77e48629ac805f37d1bd4c8acf /src/client/views/collections/CollectionMasonryViewFieldRow.tsx
parent14132f488b29641302fe10711a938b1bbdecc4fa (diff)
parent5910435416fea88d81d1868977a421c28ef05b2a (diff)
Merge branch 'master' into presentation_v1
Diffstat (limited to 'src/client/views/collections/CollectionMasonryViewFieldRow.tsx')
-rw-r--r--src/client/views/collections/CollectionMasonryViewFieldRow.tsx8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/client/views/collections/CollectionMasonryViewFieldRow.tsx b/src/client/views/collections/CollectionMasonryViewFieldRow.tsx
index 7014966c7..b35644c6b 100644
--- a/src/client/views/collections/CollectionMasonryViewFieldRow.tsx
+++ b/src/client/views/collections/CollectionMasonryViewFieldRow.tsx
@@ -138,7 +138,8 @@ export class CollectionMasonryViewFieldRow extends React.Component<CMVFieldRowPr
}
@action
- addDocument = (value: string, shiftDown?: boolean) => {
+ addDocument = (value: string, shiftDown?: boolean, forceEmptyNote?: boolean) => {
+ if (!value && !forceEmptyNote) return false;
this._createAliasSelected = false;
const key = StrCast(this.props.parent.props.Document._pivotField);
const newDoc = Docs.Create.TextDocument(value, { _autoHeight: true, _width: 200, title: value });
@@ -239,6 +240,10 @@ export class CollectionMasonryViewFieldRow extends React.Component<CMVFieldRowPr
</div>
</div>);
}
+ @action
+ textCallback = (char: string) => {
+ return this.addDocument("", false);
+ }
@computed get contentLayout() {
const rows = Math.max(1, Math.min(this.props.docList.length, Math.floor((this.props.parent.props.PanelWidth() - 2 * this.props.parent.xMargin) / (this.props.parent.columnWidth + this.props.parent.gridGap))));
@@ -247,6 +252,7 @@ export class CollectionMasonryViewFieldRow extends React.Component<CMVFieldRowPr
const newEditableViewProps = {
GetValue: () => "",
SetValue: this.addDocument,
+ textCallback: this.textCallback,
contents: "+ NEW",
HeadingObject: this.props.headingObject,
toggle: this.toggleVisibility,