diff options
author | bob <bcz@cs.brown.edu> | 2019-06-10 13:03:47 -0400 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2019-06-10 13:03:47 -0400 |
commit | c56851026c4054cde26ea36a9a24db14fac6c49c (patch) | |
tree | dba7d78e0d30a378d805a27c4f9b4360b822e812 /src/client/util/SelectionManager.ts | |
parent | a2742057084ac0c78ed5f360b1078b5b267eff1f (diff) |
fixes for treeview highlighting, templates, field deletion, overlaytext box positioning
Diffstat (limited to 'src/client/util/SelectionManager.ts')
-rw-r--r-- | src/client/util/SelectionManager.ts | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/client/util/SelectionManager.ts b/src/client/util/SelectionManager.ts index 0e22d576c..ddad4b818 100644 --- a/src/client/util/SelectionManager.ts +++ b/src/client/util/SelectionManager.ts @@ -1,4 +1,4 @@ -import { observable, action } from "mobx"; +import { observable, action, runInAction } from "mobx"; import { Doc } from "../../new_fields/Doc"; import { DocumentView } from "../views/nodes/DocumentView"; import { FormattedTextBox } from "../views/nodes/FormattedTextBox"; @@ -6,8 +6,8 @@ import { NumCast } from "../../new_fields/Types"; export namespace SelectionManager { class Manager { - @observable - SelectedDocuments: Array<DocumentView> = []; + @observable IsDragging: boolean = false; + @observable SelectedDocuments: Array<DocumentView> = []; @action SelectDoc(doc: DocumentView, ctrlPressed: boolean): void { @@ -51,6 +51,9 @@ export namespace SelectionManager { if (found) manager.SelectDoc(found, false); } + export function SetIsDragging(dragging: boolean) { runInAction(() => manager.IsDragging = dragging); } + export function GetIsDragging() { return manager.IsDragging; } + export function SelectedDocuments(): Array<DocumentView> { return manager.SelectedDocuments; } |