aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionTreeView.tsx
diff options
context:
space:
mode:
authorkimdahey <claire_kim1@brown.edu>2019-08-07 14:21:52 -0400
committerkimdahey <claire_kim1@brown.edu>2019-08-07 14:21:52 -0400
commita887adb0080d2826b8a8757cd0f5c9fe451a0695 (patch)
tree9d160db437089562c17b8abf5973f40a85bd27a8 /src/client/views/collections/CollectionTreeView.tsx
parentd673d063b1343e97b6f8f25d27347b64562fcfbe (diff)
moving computers
Diffstat (limited to 'src/client/views/collections/CollectionTreeView.tsx')
-rw-r--r--src/client/views/collections/CollectionTreeView.tsx13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/client/views/collections/CollectionTreeView.tsx b/src/client/views/collections/CollectionTreeView.tsx
index 17d043553..d7552fa99 100644
--- a/src/client/views/collections/CollectionTreeView.tsx
+++ b/src/client/views/collections/CollectionTreeView.tsx
@@ -398,9 +398,11 @@ class TreeView extends React.Component<TreeViewProps> {
panelWidth: () => number,
renderDepth: number
) {
+
let viewSpecScript = Cast(containingCollection.viewSpecScript, ScriptField);
if (viewSpecScript) {
let script = viewSpecScript.script;
+ console.log(viewSpecScript, script);
docs = docs.filter(d => {
let res = script.run({ doc: d });
if (res.success) {
@@ -411,6 +413,17 @@ class TreeView extends React.Component<TreeViewProps> {
}
});
}
+
+ // sort children here
+
+ // schemaheaderfield should b just the thing we're sorting by
+ // sortFunc = (a: [SchemaHeaderField, Doc[]], b: [SchemaHeaderField, Doc[]]): 1 | -1 => {
+ // let descending = BoolCast(this.props.document.stackingHeadersSortDescending);
+ // let firstEntry = descending ? b : a;
+ // let secondEntry = descending ? a : b;
+ // return firstEntry[0].heading > secondEntry[0].heading ? 1 : -1;
+ // }
+
let rowWidth = () => panelWidth() - 20;
return docs.map((child, i) => {
let pair = Doc.GetLayoutDataDocPair(containingCollection, dataDoc, key, child);