aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/SelectionManager.ts
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2019-12-17 16:38:19 -0800
committerSam Wilkins <samwilkins333@gmail.com>2019-12-17 16:38:19 -0800
commit10843071eacf94b237d131a50df9c58352441814 (patch)
tree854ed4e91131d5f11c4526c0cd24056adf1de2e3 /src/client/util/SelectionManager.ts
parente553c4ac4785ee1d2c57ed5d5303d6dff26929f9 (diff)
parent96ada41d4c3c411be63bd656da65bba7894a4224 (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web
Diffstat (limited to 'src/client/util/SelectionManager.ts')
-rw-r--r--src/client/util/SelectionManager.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/client/util/SelectionManager.ts b/src/client/util/SelectionManager.ts
index e01216e0f..cb7a69295 100644
--- a/src/client/util/SelectionManager.ts
+++ b/src/client/util/SelectionManager.ts
@@ -2,6 +2,8 @@ import { observable, action, runInAction, ObservableMap } from "mobx";
import { Doc } from "../../new_fields/Doc";
import { DocumentView } from "../views/nodes/DocumentView";
import { computedFn } from "mobx-utils";
+import { List } from "../../new_fields/List";
+import { Scripting } from "./Scripting";
export namespace SelectionManager {
@@ -27,6 +29,7 @@ export namespace SelectionManager {
manager.SelectedDocuments.clear();
manager.SelectedDocuments.set(docView, true);
}
+ Doc.UserDoc().SelectedDocs = new List(SelectionManager.SelectedDocuments().map(dv => dv.props.Document));
}
@action
DeselectDoc(docView: DocumentView): void {
@@ -78,3 +81,6 @@ export namespace SelectionManager {
return Array.from(manager.SelectedDocuments.keys());
}
}
+
+Scripting.addGlobal(function selectDoc(doc: any) { Doc.UserDoc().SelectedDocs = new List([doc]); });
+