aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/SelectionManager.ts
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-04-01 13:46:32 -0400
committerbob <bcz@cs.brown.edu>2019-04-01 13:46:32 -0400
commita687a9962c8952074177e52366b69dcce231a18e (patch)
tree14480487c7602324e0389b55c91b2cf2f5f2ef8c /src/client/util/SelectionManager.ts
parent5940a2dce5b45382521cd20b4770732dcbc3e732 (diff)
fixed several things related to selections and creating text boxes. moved remote cursor stuff into its own file.
Diffstat (limited to 'src/client/util/SelectionManager.ts')
-rw-r--r--src/client/util/SelectionManager.ts13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/client/util/SelectionManager.ts b/src/client/util/SelectionManager.ts
index 1a711ae64..6d6ae26fc 100644
--- a/src/client/util/SelectionManager.ts
+++ b/src/client/util/SelectionManager.ts
@@ -1,5 +1,6 @@
import { observable, action } from "mobx";
import { DocumentView } from "../views/nodes/DocumentView";
+import { Document } from "../../fields/Document"
export namespace SelectionManager {
class Manager {
@@ -29,8 +30,16 @@ export namespace SelectionManager {
return manager.SelectedDocuments.indexOf(doc) !== -1;
}
- export function DeselectAll(): void {
- manager.SelectedDocuments = []
+ export function DeselectAll(except?: Document): void {
+ let found: DocumentView | undefined = undefined;
+ if (except) {
+ for (let i = 0; i < manager.SelectedDocuments.length; i++) {
+ let view = manager.SelectedDocuments[i];
+ if (view.props.Document == except)
+ found = view;
+ }
+ }
+ manager.SelectedDocuments.length = 0;
}
export function SelectedDocuments(): Array<DocumentView> {