aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/SelectionManager.ts
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2020-06-28 17:02:08 -0400
committerBob Zeleznik <zzzman@gmail.com>2020-06-28 17:02:08 -0400
commit777030e88d177daa1f61365c22b945b8808ec61a (patch)
tree0e03fb85b8df64367b6eae36cacf42430ace408c /src/client/util/SelectionManager.ts
parentb79b5ebfd4f8ea8b4ae793e59f05b5bfe79b9b8a (diff)
parent7a78bc39fa2b005d67499bcd6baf19b9dce0eb18 (diff)
Merge branch 'master' into 3D_carousel
Diffstat (limited to 'src/client/util/SelectionManager.ts')
-rw-r--r--src/client/util/SelectionManager.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/client/util/SelectionManager.ts b/src/client/util/SelectionManager.ts
index 05515e502..024532f90 100644
--- a/src/client/util/SelectionManager.ts
+++ b/src/client/util/SelectionManager.ts
@@ -3,6 +3,8 @@ import { Doc } from "../../fields/Doc";
import { DocumentView } from "../views/nodes/DocumentView";
import { computedFn } from "mobx-utils";
import { List } from "../../fields/List";
+import { Scripting } from "./Scripting";
+import { DocumentManager } from "./DocumentManager";
export namespace SelectionManager {
@@ -10,7 +12,6 @@ export namespace SelectionManager {
@observable IsDragging: boolean = false;
SelectedDocuments: ObservableMap<DocumentView, boolean> = new ObservableMap();
-
@action
SelectDoc(docView: DocumentView, ctrlPressed: boolean): void {
// if doc is not in SelectedDocuments, add it
@@ -82,3 +83,9 @@ export namespace SelectionManager {
}
}
+
+Scripting.addGlobal(function selectDoc(doc: any) {
+ const view = DocumentManager.Instance.getDocumentView(doc);
+ view && SelectionManager.SelectDoc(view, false);
+ //Doc.UserDoc().activeSelection = new List([doc]);
+}); \ No newline at end of file