aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/trails/PresBox.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/trails/PresBox.tsx')
-rw-r--r--src/client/views/nodes/trails/PresBox.tsx14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/client/views/nodes/trails/PresBox.tsx b/src/client/views/nodes/trails/PresBox.tsx
index f4e792acd..0af7715fe 100644
--- a/src/client/views/nodes/trails/PresBox.tsx
+++ b/src/client/views/nodes/trails/PresBox.tsx
@@ -2435,9 +2435,7 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
indexNum += (index[i] * (10 ** (-i)));
}
this._treeViewMap.set(indexNum, treeViewDoc);
- console.log(String(index), treeViewDoc)
this.props.Document.presentationLinearizedDocuments = new List<Doc>(this.sort(this._treeViewMap)); // this is a flat array of Docs
- console.log(this.props.Document.presentationLinearizedDocuments)
return this.childDocs;
}
@@ -2447,21 +2445,13 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
indexNum += (index[i] * (10 ** (-i)));
}
console.log(String(index), treeViewDoc)
- this._treeViewMap.delete(indexNum)
+ this._treeViewMap.delete(indexNum);
this.props.Document.presentationLinearizedDocuments = new List<Doc>(this.sort(this._treeViewMap));
return this.childDocs;
}
// TODO: [AL] implement sort function for an array of numbers (e.g. arr[1,2,4] v arr[1,2,1])
- sort = (treeViewMap: Map<number, Doc>): Doc[] => {
- // TODO
- const sortedMap = [...treeViewMap.entries()].sort();
- var sortedDocs = [];
- for (var kv of sortedMap) {
- sortedDocs.push(kv[1]);
- }
- return sortedDocs;
- }
+ sort = (treeViewMap: Map<number, Doc>) => [...treeViewMap.entries()].sort().map(kv => kv[1]);
render() {
// calling this method for keyEvents