diff options
author | bob <bcz@cs.brown.edu> | 2019-12-16 10:40:45 -0500 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2019-12-16 10:40:45 -0500 |
commit | 9c3acfbd6ad518cd1afcc05a521480d93c07f13a (patch) | |
tree | a6c6bbbfc2250e7c6d1f1d4b9757e55128597edf /src/client/util/SelectionManager.ts | |
parent | 7584c5bed0de45f2f656fb289ff67463fb1958ef (diff) | |
parent | 001cea83f6c57914e0e76a75a94f3e06e542a419 (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.ts | 6 |
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]); }); + |