diff options
author | Tyler Schicke <tyler_schicke@brown.edu> | 2019-04-04 20:11:09 -0400 |
---|---|---|
committer | Tyler Schicke <tyler_schicke@brown.edu> | 2019-04-04 20:11:09 -0400 |
commit | 5409aa5e401b1c75c64e36ee141549b0461f1825 (patch) | |
tree | deef278987c5fb8c47638cfebcdb94fec339b6ae /src/client/util/SelectionManager.ts | |
parent | 318dacd846ab06358e26ca49e711e06434287d16 (diff) | |
parent | 4fde212cd00bd2f8fc2fa122309af3bb71bba2fd (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.ts | 16 |
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 +} |