aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/SelectionManager.ts
diff options
context:
space:
mode:
authorab <abdullah_ahmed@brown.edu>2019-04-07 10:34:27 -0400
committerab <abdullah_ahmed@brown.edu>2019-04-07 10:34:27 -0400
commit2c248fdf429d70424e398ff2b718c89f802025e9 (patch)
treeae0737b78b75dffc30002e4048abd32fe038eb78 /src/client/util/SelectionManager.ts
parent49310acbdfd7ca239c939208b3766c54e980f6f1 (diff)
parentb680f3db2f9fb6dc65f47848234e96453ef60a5c (diff)
ab committed this
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 1354e32e1..958c14491 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,15 +15,15 @@ export namespace SelectionManager {
}
if (manager.SelectedDocuments.indexOf(doc) === -1) {
- manager.SelectedDocuments.push(doc)
+ manager.SelectedDocuments.push(doc);
}
}
}
- 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 {
@@ -35,16 +35,14 @@ export namespace SelectionManager {
if (except) {
for (let i = 0; i < manager.SelectedDocuments.length; i++) {
let view = manager.SelectedDocuments[i];
- if (view.props.Document == except)
- found = view;
+ if (view.props.Document == except) found = view;
}
}
manager.SelectedDocuments.length = 0;
- if (found)
- manager.SelectedDocuments.push(found);
+ if (found) manager.SelectedDocuments.push(found);
}
export function SelectedDocuments(): Array<DocumentView> {
return manager.SelectedDocuments;
}
-} \ No newline at end of file
+}