aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/SelectionManager.ts
diff options
context:
space:
mode:
authorab <abdullah_ahmed@brown.edu>2019-04-19 17:06:56 -0400
committerab <abdullah_ahmed@brown.edu>2019-04-19 17:06:56 -0400
commitd77951f2f29b5b7b4869128116c3627d77e2c73b (patch)
tree81a0a02dc59af308ec322920a2060ac1b53d15f2 /src/client/util/SelectionManager.ts
parentbe1976fb0ba33064978ee973993b3a2316cdf43c (diff)
parentecae4ae106be3e07471208cb93ec0965548d2d12 (diff)
Merge commit 'ecae4ae' into new_search
Diffstat (limited to 'src/client/util/SelectionManager.ts')
-rw-r--r--src/client/util/SelectionManager.ts17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/client/util/SelectionManager.ts b/src/client/util/SelectionManager.ts
index 2fa45a086..320553952 100644
--- a/src/client/util/SelectionManager.ts
+++ b/src/client/util/SelectionManager.ts
@@ -2,6 +2,7 @@ import { observable, action } from "mobx";
import { DocumentView } from "../views/nodes/DocumentView";
import { Document } from "../../fields/Document";
import { Main } from "../views/Main";
+import { MainOverlayTextBox } from "../views/MainOverlayTextBox";
export namespace SelectionManager {
class Manager {
@@ -25,7 +26,17 @@ export namespace SelectionManager {
DeselectAll(): void {
manager.SelectedDocuments.map(dv => dv.props.onActiveChanged(false));
manager.SelectedDocuments = [];
- Main.Instance.SetTextDoc();
+ MainOverlayTextBox.Instance.SetTextDoc();
+ }
+ @action
+ ReselectAll() {
+ let sdocs = manager.SelectedDocuments.map(d => d);
+ manager.SelectedDocuments = [];
+ return sdocs;
+ }
+ @action
+ ReselectAll2(sdocs: DocumentView[]) {
+ sdocs.map(s => SelectionManager.SelectDoc(s, false));
}
}
@@ -51,6 +62,10 @@ export namespace SelectionManager {
if (found) manager.SelectDoc(found, false);
}
+ export function ReselectAll() {
+ let sdocs = manager.ReselectAll();
+ manager.ReselectAll2(sdocs);
+ }
export function SelectedDocuments(): Array<DocumentView> {
return manager.SelectedDocuments;
}