aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionStackingViewFieldColumn.tsx
diff options
context:
space:
mode:
authorkimdahey <claire_kim1@brown.edu>2019-09-17 16:16:20 -0400
committerkimdahey <claire_kim1@brown.edu>2019-09-17 16:16:20 -0400
commitf520d5a821b515e0c216f055e93f0549bd6733a9 (patch)
treed55d25a4280bf89d3c39fd8989700ca00b328a2e /src/client/views/collections/CollectionStackingViewFieldColumn.tsx
parent147c208a9a1196d2ded540e28dc3d7f26d5ba0a9 (diff)
parent1310633790e3db50a31a1cc6d357306d7884a053 (diff)
fixed merge conflicts
Diffstat (limited to 'src/client/views/collections/CollectionStackingViewFieldColumn.tsx')
-rw-r--r--src/client/views/collections/CollectionStackingViewFieldColumn.tsx5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/client/views/collections/CollectionStackingViewFieldColumn.tsx b/src/client/views/collections/CollectionStackingViewFieldColumn.tsx
index bc4fe7dd7..34f2652ff 100644
--- a/src/client/views/collections/CollectionStackingViewFieldColumn.tsx
+++ b/src/client/views/collections/CollectionStackingViewFieldColumn.tsx
@@ -155,6 +155,9 @@ export class CollectionStackingViewFieldColumn extends React.Component<CSVFieldC
let key = StrCast(this.props.parent.props.Document.sectionFilter);
let newDoc = Docs.Create.TextDocument({ height: 18, width: 200, documentText: "@@@" + value, title: value, autoHeight: true });
newDoc[key] = this.getValue(this.props.heading);
+ let maxHeading = this.props.docList.reduce((maxHeading, doc) => NumCast(doc.heading) > maxHeading ? NumCast(doc.heading) : maxHeading, 0);
+ let heading = maxHeading === 0 || this.props.docList.length === 0 ? 1 : maxHeading === 1 ? 2 : 3;
+ newDoc.heading = heading;
return this.props.parent.props.addDocument(newDoc);
}
@@ -180,7 +183,7 @@ export class CollectionStackingViewFieldColumn extends React.Component<CSVFieldC
if (compiled.compiled) {
let scriptField = new ScriptField(compiled);
alias.viewSpecScript = scriptField;
- let dragData = new DragManager.DocumentDragData([alias], [alias.proto]);
+ let dragData = new DragManager.DocumentDragData([alias]);
DragManager.StartDocumentDrag([this._headerRef.current!], dragData, e.clientX, e.clientY);
}