aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/SelectionManager.ts
diff options
context:
space:
mode:
authorTyler Schicke <tyler_schicke@brown.edu>2019-04-04 20:11:09 -0400
committerTyler Schicke <tyler_schicke@brown.edu>2019-04-04 20:11:09 -0400
commit5409aa5e401b1c75c64e36ee141549b0461f1825 (patch)
treedeef278987c5fb8c47638cfebcdb94fec339b6ae /src/client/util/SelectionManager.ts
parent318dacd846ab06358e26ca49e711e06434287d16 (diff)
parent4fde212cd00bd2f8fc2fa122309af3bb71bba2fd (diff)
Merge branch 'master' of github-tsch-brown:browngraphicslab/Dash-Web into propsRefactor
Diffstat (limited to 'src/client/util/SelectionManager.ts')
-rw-r--r--src/client/util/SelectionManager.ts16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/client/util/SelectionManager.ts b/src/client/util/SelectionManager.ts
index 494420f0b..5e1fa9576 100644
--- a/src/client/util/SelectionManager.ts
+++ b/src/client/util/SelectionManager.ts
@@ -1,6 +1,6 @@
import { observable, action } from "mobx";
import { DocumentView } from "../views/nodes/DocumentView";
-import { Document } from "../../fields/Document"
+import { Document } from "../../fields/Document";
export namespace SelectionManager {
class Manager {
@@ -15,7 +15,7 @@ export namespace SelectionManager {
}
if (manager.SelectedDocuments.indexOf(doc) === -1) {
- manager.SelectedDocuments.push(doc)
+ manager.SelectedDocuments.push(doc);
doc.props.onActiveChanged(true);
}
}
@@ -27,10 +27,10 @@ export namespace SelectionManager {
}
}
- const manager = new Manager;
+ const manager = new Manager();
export function SelectDoc(doc: DocumentView, ctrlPressed: boolean): void {
- manager.SelectDoc(doc, ctrlPressed)
+ manager.SelectDoc(doc, ctrlPressed);
}
export function IsSelected(doc: DocumentView): boolean {
@@ -41,17 +41,15 @@ export namespace SelectionManager {
let found: DocumentView | undefined = undefined;
if (except) {
for (const view of manager.SelectedDocuments) {
- if (view.props.Document === except)
- found = view;
+ if (view.props.Document === except) found = view;
}
}
manager.DeselectAll()
- if (found)
- manager.SelectDoc(found, false);
+ if (found) manager.SelectDoc(found, false);
}
export function SelectedDocuments(): Array<DocumentView> {
return manager.SelectedDocuments;
}
-} \ No newline at end of file
+}